@ -796,14 +796,14 @@ typedef enum OPTION_choice {
OPT_CRL_DOWNLOAD , OPT_SERVERINFO , OPT_CERTFORM , OPT_KEY , OPT_KEYFORM ,
OPT_PASS , OPT_CERT_CHAIN , OPT_DHPARAM , OPT_DCERTFORM , OPT_DCERT ,
OPT_DKEYFORM , OPT_DPASS , OPT_DKEY , OPT_DCERT_CHAIN , OPT_NOCERT ,
OPT_CAPATH , OPT_ CHAINCAPATH, OPT_VERIFYCAPATH , OPT_NO_CACHE ,
OPT_CAPATH , OPT_ NOCAPATH, OPT_ CHAINCAPATH, OPT_VERIFYCAPATH , OPT_NO_CACHE ,
OPT_EXT_CACHE , OPT_CRLFORM , OPT_VERIFY_RET_ERROR , OPT_VERIFY_QUIET ,
OPT_BUILD_CHAIN , OPT_CAFILE , OPT_ CHAINCAFILE, OPT_VERIFY CAFILE,
OPT_ NBIO, OPT_NBIO_TEST , OPT_IGN_EOF , OPT_NO_IGN_EOF , OPT_DEBUG ,
OPT_ TLSEXTDEBUG, OPT_STATUS , OPT_STATUS_VERBOSE , OPT_STATUS_TIMEOUT ,
OPT_STATUS_ URL, OPT_MSG , OPT_MSGFILE , OPT_TRACE , OPT_SECURITY_DEBUG ,
OPT_SECURITY_DEBUG _VERBOSE, OPT_STATE , OPT_CRLF , OPT_QUIET ,
OPT_ BRIEF, OPT_NO_TMP_RSA , OPT_NO_DHE , OPT_NO_ECDHE ,
OPT_BUILD_CHAIN , OPT_CAFILE , OPT_ NOCAFILE, OPT_CHAIN CAFILE,
OPT_ VERIFYCAFILE, OPT_ NBIO, OPT_NBIO_TEST , OPT_IGN_EOF , OPT_NO_IGN_EOF ,
OPT_ DEBUG, OPT_ TLSEXTDEBUG, OPT_STATUS , OPT_STATUS_VERBOSE ,
OPT_STATUS_ TIMEOUT, OPT_STATUS_ URL, OPT_MSG , OPT_MSGFILE , OPT_TRACE ,
OPT_SECURITY_DEBUG , OPT_SECURITY_DEBUG _VERBOSE, OPT_STATE , OPT_CRLF ,
OPT_ QUIET, OPT_ BRIEF, OPT_NO_TMP_RSA , OPT_NO_DHE , OPT_NO_ECDHE ,
OPT_NO_RESUME_EPHEMERAL , OPT_PSK_HINT , OPT_PSK , OPT_SRPVFILE ,
OPT_SRPUSERSEED , OPT_REV , OPT_WWW , OPT_UPPER_WWW , OPT_HTTP ,
OPT_SSL3 ,
@ -854,8 +854,12 @@ OPTIONS s_server_options[] = {
{ " msg " , OPT_MSG , ' - ' , " Show protocol messages " } ,
{ " msgfile " , OPT_MSGFILE , ' > ' } ,
{ " state " , OPT_STATE , ' - ' , " Print the SSL states " } ,
{ " CApath " , OPT_CAPATH , ' / ' , " PEM format directory of CA's " } ,
{ " CAfile " , OPT_CAFILE , ' < ' , " PEM format file of CA's " } ,
{ " CApath " , OPT_CAPATH , ' / ' , " PEM format directory of CA's " } ,
{ " no-CAfile " , OPT_NOCAFILE , ' - ' ,
" Do not load the default certificates file " } ,
{ " no-CApath " , OPT_NOCAPATH , ' - ' ,
" Do not load certificates from the default certificates directory " } ,
{ " nocert " , OPT_NOCERT , ' - ' , " Don't use any certificates (Anon-DH) " } ,
{ " quiet " , OPT_QUIET , ' - ' , " No server output " } ,
{ " no_tmp_rsa " , OPT_NO_TMP_RSA , ' - ' , " Do not generate a tmp RSA key " } ,
@ -996,6 +1000,7 @@ int s_server_main(int argc, char *argv[])
int no_dhe = 0 ;
# endif
int no_tmp_rsa = 0 , no_ecdhe = 0 , nocert = 0 , ret = 1 ;
int noCApath = 0 , noCAfile = 0 ;
int s_cert_format = FORMAT_PEM , s_key_format = FORMAT_PEM ;
int s_dcert_format = FORMAT_PEM , s_dkey_format = FORMAT_PEM ;
int rev = 0 , naccept = - 1 , sdebug = 0 , socket_type = SOCK_STREAM ;
@ -1158,6 +1163,9 @@ int s_server_main(int argc, char *argv[])
case OPT_CAPATH :
CApath = opt_arg ( ) ;
break ;
case OPT_NOCAPATH :
noCApath = 1 ;
break ;
case OPT_CHAINCAPATH :
chCApath = opt_arg ( ) ;
break ;
@ -1205,6 +1213,9 @@ int s_server_main(int argc, char *argv[])
case OPT_CAFILE :
CAfile = opt_arg ( ) ;
break ;
case OPT_NOCAFILE :
noCAfile = 1 ;
break ;
case OPT_CHAINCAFILE :
chCAfile = opt_arg ( ) ;
break ;
@ -1657,7 +1668,7 @@ int s_server_main(int argc, char *argv[])
}
# endif
if ( ! ctx_set_verify_locations ( ctx , CAfile , CApath )) {
if ( ! ctx_set_verify_locations ( ctx , CAfile , CApath , noCAfile , noCApath )) {
ERR_print_errors ( bio_err ) ;
goto end ;
}