Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSL/TLS connection to another server

Discussion in 'Security' started by Pr0Ff3z0r, Mar 28, 2012.

  1. Pr0Ff3z0r

    Pr0Ff3z0r Member

    Apr 8, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hi all,

    I need some advice on how to connect to another server using SSL/TLS.

    The owners of the other server requires dual authentication, so I have to log in using a certificate and a password. The certificate can be self signed.

    I have a python script which I run in a terminal window, logged in as root. This python script needs to connect using SSL/TLS to the other server, and after connecting, issue certain commands.

    The script requires you to use a .pem file when connecting and a typical command would look like this:
    ./ -cert=certfile.pem followed by the commands.

    My problem now is the following, I have generated the RSA key and the certificate using openssl, and I've sent the public certificate to the other party, but when I run the commands I get the following error:

    root@server [/home/account/public_html/script]# ./ -cert=certfile.pem login.xml
    Traceback (most recent call last):
    File "./", line 92, in ?
    File "./", line 38, in __init__
    self.sock.connect((host, port))
    File "/usr/lib64/python2.4/site-packages/ssl/", line 281,
    in connect
    ssl.SSLError: (336265218, '_ssl.c:347: error:140B0002:SSL
    routines:SSL_CTX_use_PrivateKey_file:system lib')
    root@server [/home/account/public_html/script]#

    When I try troubleshooting and I run openssl s_client I get the following:

    root@server [/home/account/public_html/script]# openssl s_client
    -connect otherserver:1234 -cert certfile.pem
    15118:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):s23_clnt.c:583:

    I have tried finding the solution, but to no avail. Is there specific place that I should install this certificate on my cPanel server?

    Any help would be much appreciated.



Share This Page