diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c index 8e155f30a..88a6064b4 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c @@ -347,6 +347,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) usePsk = 1; #endif +#ifdef OPENSSL_EXTRA + SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); +#endif + if (fewerPackets) CyaSSL_CTX_set_group_messages(ctx); @@ -404,10 +408,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif -#ifdef OPENSSL_EXTRA - SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); -#endif - #if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC) /* don't use EDH, can't sniff tmp keys */ if (cipherList == NULL) { diff --git a/examples/server/server.c b/examples/server/server.c index 57af48bf0..a6aaeb4ba 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -374,6 +374,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (fewerPackets) CyaSSL_CTX_set_group_messages(ctx); +#ifdef OPENSSL_EXTRA + SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); +#endif + #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) if (!usePsk) { if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM) @@ -428,10 +432,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif -#ifdef OPENSSL_EXTRA - SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); -#endif - #if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC) /* don't use EDH, can't sniff tmp keys */ if (cipherList == NULL) {