Make an https request using sockets on linux

后端 未结 2 1852
我在风中等你
我在风中等你 2020-12-16 03:39

How do I make an http request using sockets on linux? currently, I\'m getting

HTTP/1.1 301 Moved Permanently
//etc
Location: https://server.com
2条回答
  •  萌比男神i
    2020-12-16 04:33

    HTTPS is just like HTTP, but its encapsulated in a cryptographic SSL layer. You will need to use a lib like OpenSSL to make those HTTPS connections.

    OpenSSL will provide functions that replace the socket.h ones, to connect, read and write regular HTTP (or whatever other protocol you want to use) through a SSL channel, making the handling of the SSL part transparent to you.

提交回复
热议问题