Added open SSL dummy certificate check callback
This commit is contained in:
@@ -51,6 +51,14 @@ int tls_error(tls_t *tls)
|
||||
return tls->lasterror;
|
||||
}
|
||||
|
||||
static int
|
||||
cert_verify_cb(X509_STORE_CTX *x509ctx, void *arg)
|
||||
{
|
||||
xmpp_ctx_t *ctx = (xmpp_ctx_t *)arg;
|
||||
xmpp_debug(ctx, "TLS", "CERT_VERIFY_CB called");
|
||||
return 1;
|
||||
}
|
||||
|
||||
tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
|
||||
{
|
||||
tls_t *tls = xmpp_alloc(ctx, sizeof(*tls));
|
||||
@@ -65,7 +73,8 @@ tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
|
||||
|
||||
SSL_CTX_set_client_cert_cb(tls->ssl_ctx, NULL);
|
||||
SSL_CTX_set_mode (tls->ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
|
||||
SSL_CTX_set_verify (tls->ssl_ctx, SSL_VERIFY_NONE, NULL);
|
||||
SSL_CTX_set_verify (tls->ssl_ctx, SSL_VERIFY_PEER, NULL);
|
||||
SSL_CTX_set_cert_verify_callback(tls->ssl_ctx, cert_verify_cb, ctx);
|
||||
|
||||
tls->ssl = SSL_new(tls->ssl_ctx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user