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!

SSL/TLS connection to another server

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

  1. Pr0Ff3z0r

    Pr0Ff3z0r Member

    Joined:
    Apr 8, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    51
    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:
    ./scipt.py --host=otherserver.com:1234 -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]# ./script.py --host=otherserver.com:1234 -cert=certfile.pem login.xml
    Traceback (most recent call last):
    File "./script.py", line 92, in ?
    epp=EPPTCPTransport(options.host,int(options.port),usessl=not
    options.nossl,cert=options.cert)
    File "./script.py", line 38, in __init__
    self.sock.connect((host, port))
    File "/usr/lib64/python2.4/site-packages/ssl/__init__.py", line 281,
    in connect
    self.ca_certs)
    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
    CONNECTED(00000003)
    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.

    Regards

    Pr0f
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice