0

I have a certificate file(cer) sent in response to my request for a certificate and my private key . How can I use it for authentication and encryption for the connection. If I do not have , you can add to it. Sorry if this is a stupid question . I want to understand the principle . Language is not important , but if it is important I use ruby

ggoha
  • 1,996
  • 3
  • 23
  • 31

1 Answers1

0

If HTTPS is an option, you can get both server and client authentication.

There are a lot libraries for this just check httpclient gem:

# Configuring OpenSSL options. See HTTPClient::SSLConfig for more details.
user_cert_file = 'cert.pem'
user_key_file = 'privkey.pem'
clnt.ssl_config.set_client_cert_file(user_cert_file, user_key_file)
clnt.get_content(https_url)

and this topic HTTP library for Ruby with HTTPS, SSL Client Certificate and Keep-Alive support?

Community
  • 1
  • 1
andrykonchin
  • 2,507
  • 3
  • 18
  • 24