File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ def find_openssl_library
174
174
have_func ( "SSL_set0_tmp_dh_pkey" )
175
175
have_func ( "ERR_get_error_all" )
176
176
have_func ( "TS_VERIFY_CTX_set_certs(NULL, NULL)" , "openssl/ts.h" )
177
+ have_func ( "SSL_CTX_load_verify_file" )
177
178
178
179
Logging ::message "=== Checking done. ===\n "
179
180
Original file line number Diff line number Diff line change @@ -828,10 +828,17 @@ ossl_sslctx_setup(VALUE self)
828
828
ca_file = NIL_P (val ) ? NULL : StringValueCStr (val );
829
829
val = rb_attr_get (self , id_i_ca_path );
830
830
ca_path = NIL_P (val ) ? NULL : StringValueCStr (val );
831
+ #ifdef HAVE_SSL_CTX_LOAD_VERIFY_FILE
832
+ if (ca_file && !SSL_CTX_load_verify_file (ctx , ca_file ))
833
+ ossl_raise (eSSLError , "SSL_CTX_load_verify_file" );
834
+ if (ca_path && !SSL_CTX_load_verify_dir (ctx , ca_path ))
835
+ ossl_raise (eSSLError , "SSL_CTX_load_verify_dir" );
836
+ #else
831
837
if (ca_file || ca_path ){
832
838
if (!SSL_CTX_load_verify_locations (ctx , ca_file , ca_path ))
833
839
rb_warning ("can't set verify locations" );
834
840
}
841
+ #endif
835
842
836
843
val = rb_attr_get (self , id_i_verify_mode );
837
844
verify_mode = NIL_P (val ) ? SSL_VERIFY_NONE : NUM2INT (val );
You can’t perform that action at this time.
0 commit comments