I am trying the https_client sample and I can get it to work unchanged.
But I would like to connect to a different site than www.example.com.
As far as I can understand what I need to do is:
change "example.com" in the HTTP_HEAD to another site (i've tried "vecka.nu")
change "example.com" in the gettaddrinfo() call to another site (i've tried "vecka.nu"
change the certificate used to one that works with the new site:
I got the new certificate by visiting www.vecka.nu in chrome,
- clicking the lock to the left of the address bar,
- selecting certificate
- going to the Details tab
- clicking the Copy to File... button
- selecting Base-64 encoded x.509 (.CER)
- saving the file in the cert folder of the https_client sample
- adding " to the beginning of each line and \n" to the end of each line in the new .cer file
When I do this I get this output:
I also followed the same procedure to download the certificate from www.example.com in chrome, and noticed that the certificate did not match the certificate that came with the sample, so I suspect that I am not using the correct certificate.
How should I obtain the certificate for different websites?