arduino gets response 301 when making a HTTPS GET request


I am making a simple arduino app that send a GET request to a HTTPS site. The code I’m using is exactly the same as the code in the MKRGSM library examples (GsmSslWebClient). But for whatever reason I always get the same response when connecting to a HTTPS site: “301 moved permanently”. I kind of know what that means, I am aware that you are supposed to just make another request to the location specified in the header.
But I don’t know what I have to change to be able to address a https site.

I would also point out here, that I have tried changing port to 80 and client settings, to work for unprotected http which works just fine. So its just the https that doesn’t work.

the details about the example that I was using can be found here:
(note: I have ran it without any change at first, triple checked)

the output is the standard301 response:

Starting Arduino web client.
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 19 Nov 2020 20:24:07 GMT
Content-Type: text/html
Content-Length: 178
Connection: close
Strict-Transport-Security: max-age=500; includeSubDomains
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block

301 Moved Permanently

301 Moved Permanently



It is also possible that I’m just stupid and the answer is clear as day, but if somebody could please tell me exactly what to do, maybe even put an example, that would be greatly appreciated.

I haven’t really tried much except changing the setting to see if they work for normal http and some other libraries that worked even worse. I also tried several different websites and several different forms of server names (I tried adding “www.” to the server name and so on.), but that just ended in server unable to connect.

Sadly that’s all I could find on the internet and I’m not that skilled to be messing with libraries on my own. I am using arduino mkr gsm 1400.

Be sure to call me out if I missed to mention any detail that could help solving this issue

Thanks to anybody that can help me in advance.

what URI are you requesting?
the server tells you the new location:


this can be loaded in the browser the first time (200), and because of the ETag, sequent requests get a 304 Not Modified