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
Asked
Active
Viewed 192 times
0
-
Please clarify, what are you looking for - keeping ssl connection with a remote server or encrypt messages and pass a client authentication manually? – andrykonchin Nov 02 '15 at 09:30
-
I try understand, how i can start encrypted connection with remote server using SSL – ggoha Nov 02 '15 at 09:42
-
Am I right, you want a remote server authenticate the client? Are you going to use HTTP protocol or sockets? – andrykonchin Nov 02 '15 at 09:47
-
I use HTTP, and i want authenticate using certificate – ggoha Nov 02 '15 at 10:03
1 Answers
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