Not able to use HTTP class in Online

Hi, Trying to recive data with HTTP in SO Online:

#setLanguageLevel 3;

HTTP h;
h.setDebugMode(true);
h.addHeader("content-type", "application/json;utf+8");
Byte[] jsonAsBytes = h.get("https://data.ssb.no/api/klass/v1/versions/30");
printLine(h.getDebug());

Debug shows/prints nothing and no data recieved. This worked before.

From onPrem (SO 9.2 R12) it works as expected. Print debug shows:

== Info
CURLOPT_SSL_VERIFYHOST no longer supports 1 as value!

== Info
Trying 193.160.172.252...

== Info
TCP_NODELAY set

== Info
Connected to data.ssb.no (193.160.172.252) port 443 (#0)

== Info
ALPN, offering http/1.1

== Info
Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

== Info
successfully set certificate verify locations:

== Info
CAfile: C:\SuperOfficeDEV\SO_SERVICE/curl-ca-bundle.crt
CApath: none

== Info
TLSv1.2 (OUT), TLS header, Certificate Status (22):

== Info
TLSv1.2 (OUT), TLS handshake, Client hello (1):

== Info
TLSv1.2 (IN), TLS handshake, Server hello (2):

== Info
TLSv1.2 (IN), TLS handshake, Certificate (11):

== Info
TLSv1.2 (IN), TLS handshake, Server finished (14):

== Info
TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

== Info
TLSv1.2 (OUT), TLS change cipher, Client hello (1):

== Info
TLSv1.2 (OUT), TLS handshake, Finished (20):

== Info
TLSv1.2 (IN), TLS change cipher, Client hello (1):

== Info
TLSv1.2 (IN), TLS handshake, Finished (20):

== Info
SSL connection using TLSv1.2 / AES256-SHA

== Info
ALPN, server accepted to use http/1.1

== Info
Server certificate:

== Info
subject: C=NO; postalCode=0177; L=OSLO; O=STATISTISK SENTRALBYR.; CN=*.ssb.no; 

== Info
start date: Jan 12 09:23:15 2021 GMT

== Info
expire date: Feb 8 22:59:00 2022 GMT

== Info
subjectAltName: host "data.ssb.no" matched cert's "*.ssb.no"

== Info
issuer: C=NO; O=Buypass AS-983163327; CN=Buypass Class 2 CA 2

== Info
SSL certificate verify ok.

=> Send header
GET /api/klass/v1/versions/30 HTTP/1.1
Host: data.ssb.no
Accept: */*
content-type: application/json;utf+8
traceparent: 00--52504bf495c026d5-00


<= Recv header
HTTP/1.1 200 OK

<= Recv header
X-Application-Context: application:mariadb,api,remote-solr,skip-indexing:8080

<= Recv header
Cache-Control: no-cache, no-store, max-age=0, must-revalidate

<= Recv header
Pragma: no-cache

<= Recv header
Expires: 0

<= Recv header
Access-Control-Allow-Origin: *

<= Recv header
Vary: Accept, X-Forwarded-Proto

<= Recv header
Content-Type: application/hal+json;charset=UTF-8

<= Recv header
Date: Tue, 05 Oct 2021 08:32:34 GMT

<= Recv header
X-Varnish: 276148065

<= Recv header
Age: 0

<= Recv header
Via: 1.1 varnish (Varnish/6.0)

<= Recv header
Content-Security-Policy: upgrade-insecure-requests

<= Recv header
Expect-CT: enforce, max-age=3600

<= Recv header
Referrer-Policy: no-referrer-when-downgrade

<= Recv header
Strict-Transport-Security: max-age=86400

<= Recv header
X-Content-Type-Options: nosniff

<= Recv header
X-Frame-Options: SAMEORIGIN

<= Recv header
X-XSS-Protection: 1; mode=block

<= Recv header
X-Cache: MISS

<= Recv header
X-UA-Compatible: IE=Edge

<= Recv header
Set-Cookie: X-Identity=42295914.090; Path=/; Secure; HttpOnly

<= Recv header
Accept-Ranges: bytes

<= Recv header
Transfer-Encoding: chunked

<= Recv header
Connection: keep-alive

<= Recv header
Set-Cookie: ssbno=ffffffffc2a8b2e445525d5f4f58455e445a4a423660;expires=Tue, 05-Oct-2021 09:32:34 GMT;path=/;secure;httponly

<= Recv header


<= Recv data
006abc
{"name":"N..ringsgruppering 2007 (SN 2007)","validFrom":"2009-01-01","lastModified":"2020-04-07T12:46:55.000+0000","published":["nb","nn","en"],"introduction":"Grunnlaget for SN2007 er EUs standard NACE Rev.2 (Nomenclature g..n..rale des Activit..s economiques dans les Communaut..s Europ..enes) og FNs standard ISIC Rev.4 (International Standard Industrial Classification of all Economic Activities.\n\nNACE Rev.2 og SN2007 bygger p.. ISIC Rev.4 som ble godkjent i 2006. NACE Rev.2 har samme struktur som ISIC Rev.4, men NACE Rev.2 er mer detaljert enn ISIC Rev.4 p.. 3- og 4-sifferniv... Gjennom .. aggregere NACE-grupper vil en komme fram til ISICs 3- og 4- siffergrupper.\n\nNed til 4-sifret niv.. (n..ringsgruppe) er SN2007 identisk med NACE Rev.2. Ut fra behovet for en mer detaljert n..ringsinndeling tilpasset norske...........

== Info
TLSv1.2 (IN), TLS alert, Client hello (1):

== Info
transfer closed with outstanding read data remaining

== Info
Closing connection 0

== Info
TLSv1.2 (OUT), TLS alert, Client hello (1):

Has the HTTP class been blocked in online for some reason? This is critical.

RE: Not able to use HTTP class in Online

Seems to work fine for me on Online Production:

#setLanguageLevel 3;

HTTP httpReq;
httpReq.addHeader("Content-Type", "application/json; charset=utf-8");

NSStream response = httpReq.getAsStream("https://data.ssb.no/api/klass/v1/versions/30");

print(String(response).utf8Decode());
By: David Hollegien 5 Oct 2021

RE: Not able to use HTTP class in Online

Strange,

Not working for me. When I run the script I don't reciving anything:

#setLanguageLevel 3;
HTTP h;
h.setDebugMode(true);
h.addHeader("content-type", "application/json;utf+8");
Byte[] jsonAsBytes = h.get("https://data.ssb.no/api/klass/v1/versions/30");
printLine(h.getDebug());

 

Hmmm.... tested on another customer and there it's working:

The difference is: online.superoffice.com/Cust.... (not working) and online2.superoffice.com/Cust.... (working).

Think this is a case for operations.

 

 

 

By: Henning Dahl 5 Oct 2021

RE: Not able to use HTTP class in Online

Hi Henning,

I have tried to reproduce your error without success. Does this problem still exist?

By: Michel Krohn-Dale 5 Oct 2021