Support Forums
Using REST API Call to retrieve tag data throws error: "OpenSSL SSL_read: Connection was reset, errno 10054"

I am trying to use the following php code to call the REST API:

<?php

$ch = curl_init();

$burl = "https://server2.novusprime.ai/Realm02/REST/SQLQuery?query=Select Timestamp,'JOB\Well 01\Operation Grid Type:zone' FROM History";

curl_setopt($ch, CURLOPT_URL, $burl);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD,  '<username>:<password>');

$resp = curl_exec($ch);

if($e = curl_error($ch)) {
    echo $e;
}
else {
    $decoded = json_decode($resp);
    print_r($decoded);
}
curl_close($ch);

?>

I am getting the following error.

OpenSSL SSL_read: Connection was reset, errno 10054

Any help to resolve or an example REST API call script will help. Thanks.

I am trying to use the following php code to call the REST API: &lt;?php $ch = curl_init(); $burl = &quot;https://server2.novusprime.ai/Realm02/REST/SQLQuery?query=Select Timestamp,&#039;JOB\Well 01\Operation Grid Type:zone&#039; FROM History&quot;; curl_setopt($ch, CURLOPT_URL, $burl); curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, &#039;&lt;username&gt;:&lt;password&gt;&#039;); $resp = curl_exec($ch); if($e = curl_error($ch)) { echo $e; } else { $decoded = json_decode($resp); print_r($decoded); } curl_close($ch); ?&gt; I am getting the following error. OpenSSL SSL_read: Connection was reset, errno 10054 Any help to resolve or an example REST API call script will help. Thanks.

Bit of a tricky one, this OpenSSL error can occur if there's something up with the servers x.509 certificate.

Can you try using the Open SSL client to connect to the server and retrieve the certificate info:

openssl s_client -connect https://server2.novusprime.ai:443 | openssl x509 -noout -subject -dates -ext subjectAltName
Bit of a tricky one, this OpenSSL error can occur if there&#039;s something up with the servers x.509 certificate. Can you try using the Open SSL client to connect to the server and retrieve the certificate info: openssl s_client -connect https://server2.novusprime.ai:443 | openssl x509 -noout -subject -dates -ext subjectAltName

Software Developer with Trihedral

114
1
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft