The smallest minimal example of an HTTPS GET request with openssl

Viktor Dukhovni openssl-users at dukhovni.org
Sat Mar 30 18:53:11 UTC 2019


On Sat, Mar 30, 2019 at 04:02:55PM +0100, Ivan Medoedov wrote:

> I've only managed to find this, but it seems to do too much for what I need:
> 
> https://wiki.openssl.org/index.php/SSL/TLS_Client
> 
> Basically I need something like Go's http.Get("https://mysite.com/version")
> to just get a one line of text from the server.
> 
> I can't use libcurl, I have to use pure openssl.

OpenSSL is NOT an HTTPS (client or server) library.  OpenSSL can
establish a TLS connection, but does not implement anything like
"http.Get".  That's what libcurl and the like are for.

If you're willing to roll your own HTTP client code, then you
can use OpenSSL for the TLS part of the HTTPS transaction.

HTTP clients handle all sorts of complications over and above TLS:

    * Proxies
    * Redirects
    * Client requests with bodies
    * Authentication
    * Chunked transfer encoding
    * Content encoding (e.g. gzip)
    * Cookies
    ...

None of these are in scope for OpenSSL.

-- 
	Viktor.


More information about the openssl-users mailing list