Matheus Fernandes

Registered
May 11, 2018
2
0
1
brazil
cPanel Access Level
Root Administrator
WHM version: 70
OS: CLOUDLINUX 6.9

Client API Server OS: Windows 2008 R2 Standard
Client API Language: asp classic/vbscript

I have the asp code below to communicate with whm api but it's not working.

<%
user = "root"
token = "****"
url = "https://whmurl:2087/json-api/createacct"
query = "api.version=1&username=matheus&domain=mathexample.com&plan=teste&quota=0&password=*****&ip=n&cgi=1&contactemail=matheus%40domain.com.br&mxcheck=local&owner=root&language=pt_br"​

Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

With http
Call .Open("GET", url, False)
Call .SetRequestHeader("Content-Type", "text/plain; charset='utf-8'")
Call .SetRequestHeader("Authorization", "whm "&user&":"&token)
Call .Send(data)
End With

If Left(http.Status, 1) = 2 Then
'Request succeeded with a HTTP 2xx response, do something...
Else
'Output error
Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
I always get this error:

WinHttp.WinHttpRequest error '80072f8f'
A security error occurred
**.asp, line 13 (in bold)

I debuged and I get:
* About to connect() to whmurl port 2087 (#0)
* Trying [ip]...
* connected
* Connected to whmurl ([ip]) port 2087 (#0)
* error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
* Closing connection #0

Any clue? Is it related to TLS or SSL versions?
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
7,940
630
263
Houston
cPanel Access Level
DataCenter Provider
Hello,


I believe this is directly related to SSL/TLS protocols. It appears you're attempting to connect to the server over SSLv2 or SSLv3 when SSLvX support has been removed in favor of TLSv1.2

In order to connect you'll need to do so over TLSv1.2 or use the less favorable option and enable support for SSLvX on the server. Because of vulnerabilities such as POODLE and DROWN we strongly urge you not to take this route.


Thanks!