@@ -196,13 +196,13 @@ static int cert_setup_callback(WOLFSSL *ssl, void *_arg) {
196196 if (wolfSSL_use_certificate_file (ssl , certFileName , SSL_FILETYPE_PEM ) !=
197197 WOLFSSL_SUCCESS ) {
198198 fprintf (stderr , "ERROR: failed to load %s, please check the file.\n" ,
199- CERT_FILE );
199+ certFileName );
200200 return 0 ;
201201 }
202202 if (wolfSSL_use_PrivateKey_file (ssl , keyFileName , SSL_FILETYPE_PEM ) !=
203203 WOLFSSL_SUCCESS ) {
204204 fprintf (stderr , "ERROR: failed to load %s, please check the file.\n" ,
205- KEY_FILE );
205+ keyFileName );
206206 return 0 ;
207207 }
208208 return 1 ;
@@ -296,22 +296,6 @@ int main(int argc, char** argv)
296296 */
297297 wolfSSL_CTX_set_cert_cb (ctx , cert_setup_callback , NULL );
298298
299- /* Load server certificates into WOLFSSL_CTX */
300- if ((ret = wolfSSL_CTX_use_certificate_file (ctx , CERT_FILE ,
301- WOLFSSL_FILETYPE_PEM )) != WOLFSSL_SUCCESS ) {
302- fprintf (stderr , "ERROR: failed to load %s, please check the file.\n" ,
303- CERT_FILE );
304- goto exit ;
305- }
306-
307- /* Load server key into WOLFSSL_CTX */
308- if ((ret = wolfSSL_CTX_use_PrivateKey_file (ctx , KEY_FILE ,
309- WOLFSSL_FILETYPE_PEM )) != WOLFSSL_SUCCESS ) {
310- fprintf (stderr , "ERROR: failed to load %s, please check the file.\n" ,
311- KEY_FILE );
312- goto exit ;
313- }
314-
315299 /* Load client certificate as "trusted" into WOLFSSL_CTX */
316300 if ((ret = wolfSSL_CTX_load_verify_locations (ctx , CA_FILE , NULL ))
317301 != WOLFSSL_SUCCESS ) {
0 commit comments