@@ -47,31 +47,13 @@ jobs:
4747 run : dotnet build -c Release --framework ${{ matrix.framework }}
4848 working-directory : test
4949
50- - name : Generate TLS certs for Docker
50+ - name : Pack client cert, key, ca for C# docker client
5151 run : |
5252 mkdir -p ${{ github.workspace }}/certs
5353 sudo chmod 777 ${{ github.workspace }}/certs
5454
55- # Generate CA key and cert
56- openssl genrsa -out ${{ github.workspace }}/certs/ca-key.pem 2048
57- openssl req -x509 -new -nodes -key ${{ github.workspace }}/certs/ca-key.pem -sha256 -days 365 -out ${{ github.workspace }}/certs/ca.pem -subj "/CN=docker-ca"
58-
59- # Generate server key and CSR
60- openssl genrsa -out ${{ github.workspace }}/certs/server-key.pem 2048
61- openssl req -new -key ${{ github.workspace }}/certs/server-key.pem -out ${{ github.workspace }}/certs/server.csr -subj "/CN=localhost"
62-
63- # Sign server cert with CA
64- openssl x509 -req -in ${{ github.workspace }}/certs/server.csr -CA ${{ github.workspace }}/certs/ca.pem -CAkey ${{ github.workspace }}/certs/ca-key.pem -CAcreateserial -out ${{ github.workspace }}/certs/server-cert.pem -days 365 -sha256
65-
66- # Generate client key and CSR
67- openssl genrsa -out ${{ github.workspace }}/certs/key.pem 2048
68- openssl req -new -key ${{ github.workspace }}/certs/key.pem -out ${{ github.workspace }}/certs/client.csr -subj "/CN=client"
69-
70- # Sign client cert with CA
71- openssl x509 -req -in ${{ github.workspace }}/certs/client.csr -CA ${{ github.workspace }}/certs/ca.pem -CAkey ${{ github.workspace }}/certs/ca-key.pem -CAcreateserial -out ${{ github.workspace }}/certs/cert.pem -days 365 -sha256
72-
7355 # create pfx
74- openssl pkcs12 -export -out ${{ github.workspace }}/certs/client.pfx -inkey ${{ github.workspace }}/certs/key.pem -in ${{ github.workspace }}/certs/cert.pem -certfile ${{ github.workspace }}/certs/ca.pem -passout pass:
56+ openssl pkcs12 -export -out ${{ github.workspace }}/certs/client.pfx -inkey ${{ github.workspace }}/certs/client/ key.pem -in ${{ github.workspace }}/certs/client/ cert.pem -certfile ${{ github.workspace }}/certs/client /ca.pem -passout pass:
7557
7658 - name : Wait for Docker (no TLS) to be healthy
7759 run : |
9072 run : |
9173 for i in {1..10}; do
9274 if docker --host=tcp://localhost:2376 --tlsverify \
93- --tlscacert=${{ github.workspace }}/certs/ca.pem \
94- --tlscert=${{ github.workspace }}/certs/cert.pem \
95- --tlskey=${{ github.workspace }}/certs/key.pem version; then
75+ --tlscacert=${{ github.workspace }}/certs/client/ ca.pem \
76+ --tlscert=${{ github.workspace }}/certs/client/ cert.pem \
77+ --tlskey=${{ github.workspace }}/certs/client/ key.pem version; then
9678 echo "Docker (TLS) is ready!"
9779 exit 0
9880 fi
0 commit comments