HTTPS/Client-authenticated: Difference between revisions
({{omit from|Locomotive Basic}}) |
({{omit from|Lotus 123 Macro Scripting}}) |
||
Line 28: | Line 28: | ||
{{omit from|Inform 7|Does not have network access.}} |
{{omit from|Inform 7|Does not have network access.}} |
||
{{omit from|Locomotive Basic|Does not have network access.}} |
{{omit from|Locomotive Basic|Does not have network access.}} |
||
{{omit from|Lotus 123 Macro Scripting}} |
|||
{{omit from|M4}} |
{{omit from|M4}} |
||
{{omit from|PARI/GP}} |
{{omit from|PARI/GP}} |
Revision as of 08:52, 6 July 2011
You are encouraged to solve this task according to the task description, using any language you may know.
Demonstrate how to connect to a web server over HTTPS where that server requires that the client present a certificate to prove who (s)he is. Unlike with the HTTPS request with authentication task, it is not acceptable to perform the authentication by a username/password or a set cookie.
This task is in general useful for use with webservice clients as it offers a high level of assurance that the client is an acceptable counterparty for the server. For example, Amazon Web Services uses this style of authentication.
Tcl
Uses the Tls package. <lang tcl>package require http package require tls
set cert myCert.p12 http::register https 443 [list \
::tls::socket -certfile $cert -password getPass]
proc getPass {} {
return "myPassword"; # Just a noddy example...
}
- Make a secure authenticated connection
set token [http::geturl https://verysecure.example.com/]
- Now as for conventional use of the “http” package
set data [http::data $token] http::cleanup $token</lang>