@@ -9,9 +9,9 @@ Maintainer : deni@denibertovic.com
99Stability : experimental
1010Portability : POSIX
1111
12−Getting started
12+= Getting started
1313
14−* Creating a container:
14+Creating a container:
1515
1616We're going to create a nginx container and we're going to map port @80@ from within the container to port @8000@ on
1717the host.
@@ -51,11 +51,35 @@ stopNginxContainer cid = runDockerT (defaultClientOpts, defaultHttpHandler) $ do
5151
5252>>> stopNginxContainer cid
5353
54−* Get Docker API Version:
54+= Get Docker API Version
5555
5656>>> runDockerT (defaultClientOpts, defaultHttpHandler) $ getDockerVersion
5757Right (DockerVersion {version = "1.12.0", apiVersion = "1.24", gitCommit = "8eab29e", goVersion = "go1.6.3", os = "linux", arch = "amd64", kernelVersion = "4.6.0-1-amd64", buildTime = "2016-07-28T21:46:40.664812891+00:00"})
5858
59+= Setup SSL Authentication
60+
61+Let's create a custom 'HttpHandler' that uses a client's certificate and private key for SSL authentication.
62+It also accepts a self-signed CA certificate which is specified via 'clientParamsSetCA'.
63+This handler can replace 'defaultHttpHandler' in the arguments to 'runDockerT'.
64+
65+@
66+let host = "domain.name"
67+let port = fromInteger 4000
68+let privKey = "path\/to\/private\/key"
69+let cert = "path\/to\/certificate"
70+let ca = "path\/to\/CA"
71+paramsE <- clientParamsWithClientAuthentication host port privKey cert
72+case paramsE of
73+ Left err ->
74+ error err
75+ Right params' -> do
76+ params <- clientParamsSetCA params' ca
77+ settings <- HTTP.mkManagerSettings (TLSSettings params) Nothing
78+ manager <- newManager settings
79+ return $ httpHandler manager
80+@
81+
82+
5983-}
6084module Docker.Client (
6185 -- * Client functions