SSL_read

SSL_readでレスポンスを読み込む。

/docs/man1.1.0/ssl/SSL_read.html

SSL_read.cで、

SSL_readで1023バイトずつ読み込んで、読み込んだバイトを出力していくのを繰り返す。

$ vi SSL_read.c 
$ gcc -o SSL_read SSL_read.c -lssl -lcrypto
$ ./SSL_read 
connect success.
ctx = 01a05ff0
ssl = 01a06c20
SSL_set_fd success!
SSL_connect success!
request_len = 61
SSL_write written = 61
HTTP/1.1 200 OK
Date: Sun, 21 May 2017 08:22:55 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=Shift_JIS
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID=103=Ax4uzv60vWI_ZCgYLlXAjuO383mkk7NyT9ukFIdzWn33HotKlafmUkjXAYVGl6iDsrkfGHjXZNTK0pooeYSX_mNU0xYMARamNB6ap-RiGfDWWnIhYrGD34XrAPdDkCsq; expires=Mon, 20-Nov-2017 08:22:55 GMT; path=/; domain=.google.co.jp; HttpOnly
Alt-Svc: quic=":443"; ma=2592000; v="37,36,35"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close

<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="ja"><head><meta 

(略)

</script></div></body></html>$

レスポンスを読み込んで出力した。

Sample/openssl/SSL_read/SSL_read/src/SSL_read at master · bg1bgst333/Sample · GitHub