Skip to content

Commit 07d320b

Browse files
committed
WinRM cert updates
1 parent 67de9da commit 07d320b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

SetupWinRMCertificateAuth.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ $ErrorActionPreference = "Stop"
33
$username = "Administrator"
44
$password = "Passw0rd"
55

6-
# The X509 certs can be combined in a #PKCS12 file
76
$client_cert_path = "$(pwd)\cert.pem"
87
$client_ca_cert_path = "$(pwd)\ca.pem"
98

generate_winrm_client_cert.sh

+7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ set -e
44
USER_NAME=user$RANDOM
55

66
UPN=$USER_NAME@localhost
7+
78
PFX_FILE=`pwd`/cert.pfx
89
PFX_PASSWORD=Passw0rd
910

11+
PEM_FILE=`pwd`/cert.pem
12+
PEM_CA_FILE=`pwd`/ca.pem
13+
1014
CA_DIR=`mktemp -d -t openssl`
1115

1216
pushd .
@@ -111,6 +115,9 @@ rm $EXT_CONF_FILE
111115
# Export the certificate, including the CA chain, into cert.pfx
112116
openssl pkcs12 -export -in certs/cert.pem -inkey private/cert.key -chain -CAfile certs/ca.pem -out $PFX_FILE -password pass:$PFX_PASSWORD
113117

118+
cp certs/cert.pem $PEM_FILE
119+
cp certs/ca.pem $PEM_CA_FILE
120+
114121
popd
115122
rm -rf $CA_DIR
116123

0 commit comments

Comments
 (0)