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.

XML API - sslv3 alert handshake failure

Discussion in 'cPanel Developers' started by Posterum, May 27, 2015.

  1. Posterum

    Posterum Member

    Joined:
    May 27, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Hi,

    I have a script that uses xmlapi.php to register email accounts.

    The other day I got this error:
    Code:
    Fatal error: Uncaught exception 'Exception' with message 'curl_exec threw error "error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure" for https://**IP**:2083/xml-api/cpanel?domain=****.com&email=sdf34&password=**password**&quota=500&cpanel_xmlapi_user=****.com&cpanel_xmlapi_module=Email&cpanel_xmlapi_func=addpop&cpanel_xmlapi_apiversion=2' in /home/****/public_html/reg/lib/xmlapi.php:758 Stack trace: #0 /home/****/public_html/reg/lib/xmlapi.php(676): xmlapi->curl_query('https://**IP**', 'domain=****.com...', 'Authorization: ...') #1 /home/****/public_html/reg/lib/xmlapi.php(915): xmlapi->xmlapi_query('cpanel', Array) #2 /home/****/public_html/reg/lib/class_cpanel.php(36): xmlapi->api2_query('****.com', 'Email', 'addpop', Array) #3 /home/****/public_html/reg/comp.php(11): MyCpanel->AddEmail('**username**', '**password**', '500') #4 {main} thrown in /home/****/public_html/reg/lib/xmlapi.php on line 758
    
    Does anyone know how I can fix this?

    Thanks in advance

    Regards
     
    #1 Posterum, May 27, 2015
    Last edited by a moderator: May 27, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Does the issue persist if you use the same function on it's own with the "API Shell" option in WHM or directly from a browser address bar? This should help determine if it's isolated to your custom script or the API function itself.

    Thank you.
     
  3. Posterum

    Posterum Member

    Joined:
    May 27, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Thanks for your fast reply.

    If i do it directly from the address bar (URL:
    Code:
    https://**IP**:2083/xml-api/cpanel?domain=****.com&email=**email**&password=**password**&quota=500&cpanel_xmlapi_user=****.com&cpanel_xmlapi_module=Email&cpanel_xmlapi_func=addpop&cpanel_xmlapi_apiversion=2
    )

    I get this:
    Code:
    <cpanelresult>
    <error>Access denied</error>
    <data>
    <result>0</result>
    <reason>Access denied</reason>
    </data>
    </cpanelresult>
    
    I get the same whether API Shell is enabled or not, if that's what you mean?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Here's a working example:

    Code:
    https://1.2.3.4:2083/cpsess4565251922/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=addpop&domain=cptest01.com&email=test1&password=12345luggage&quota=100
    Do you experience the same issue when formatting the URL like this? Note the importance of the session number.

    Thank you.
     
  5. Posterum

    Posterum Member

    Joined:
    May 27, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Thanks,

    I get this, Access denied:
    Code:
    {"cpanelresult":{"apiversion":"2","error":"Access denied","data":{"reason":"Access denied","result":"0"},"type":"text"}}

    I get this error when trying to connect to the mail server using imap port 993
    Code:
    stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure 
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Your access level is listed as "Website Owner". Do you have root access to this server? If not, could you consult with your web hosting provider for assistance with the IMAP error?

    Thank you.
     
  7. Posterum

    Posterum Member

    Joined:
    May 27, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Yes I have root access to the server. I do not have a hosting provider that can assistance me.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  9. Posterum

    Posterum Member

    Joined:
    May 27, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    Thank a lot, the ticket id is 6610623
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, the user has been advised to try the "--insecure" flag to verify if the failure is due to insecure resources or SSL in the script.

    Thank you.
     
Loading...

Share This Page