Method: HTTPClient::SSLConfig#set_client_cert_file
- Defined in:
- lib/httpclient/ssl_config.rb
#set_client_cert_file(cert_file, key_file) ⇒ Object
Sets certificate and private key for SSL client authentication.
- cert_file
-
must be a filename of PEM/DER formatted file.
- key_file
-
must be a filename of PEM/DER formatted file. Key must be an RSA key. If you want to use other PKey algorithm, use client_key=.
Calling this method resets all existing sessions.
114 115 116 117 118 |
# File 'lib/httpclient/ssl_config.rb', line 114 def set_client_cert_file(cert_file, key_file) @client_cert = X509::Certificate.new(File.open(cert_file).read) @client_key = PKey::RSA.new(File.open(key_file).read) change_notify end |