Skip to content

Commit

Permalink
Clear SSL error stack on each new SSL ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
smokku committed Jul 28, 2008
1 parent 8290498 commit ac3d0f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sx/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,6 @@ int sx_ssl_init(sx_env_t env, sx_plugin_t p, va_list args) {
SSL_load_error_strings();
}
sx_openssl_initialized = 1;
/* begin with fresh error stack */
ERR_clear_error();

ret = sx_ssl_server_addcert(p, name, pemfile, cachain, mode);
if(ret)
Expand Down Expand Up @@ -740,6 +738,9 @@ int sx_ssl_server_addcert(sx_plugin_t p, char *name, char *pemfile, char *cachai
if(pemfile == NULL)
return 1;

/* begin with fresh error stack */
ERR_clear_error();

/* create the context */
ctx = SSL_CTX_new(SSLv23_method());
if(ctx == NULL) {
Expand Down

0 comments on commit ac3d0f9

Please sign in to comment.