HTTPS/Authenticated: Difference between revisions
Content added Content deleted
(Go solution) |
(Racket) |
||
Line 228: | Line 228: | ||
print response.read()</lang> |
print response.read()</lang> |
||
=={{header|Racket}}== |
|||
<lang Scheme> |
|||
#lang racket |
|||
(require net/url |
|||
net/url-connect |
|||
openssl) |
|||
(module+ main |
|||
(parameterize ([current-https-protocol (ssl-make-client-context)]) |
|||
(ssl-set-verify! (current-https-protocol) #t) |
|||
;; When this is #f, we correctly get an exception: |
|||
;; error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed |
|||
(when #t |
|||
(ssl-load-verify-source! (current-https-protocol) |
|||
'(directory |
|||
;; This location works on Debian 6; |
|||
;; adjust as needed for your platform. |
|||
"/etc/ssl/certs" |
|||
))) |
|||
(for ([l (in-port read-line (get-pure-port (string->url "https://www.google.com/")))]) |
|||
(displayln l)))) |
|||
</lang> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
{{works with|Tcl|8.6}} for the <code>binary encode</code> subcommand, otherwise uses |
{{works with|Tcl|8.6}} for the <code>binary encode</code> subcommand, otherwise uses |