@@ -39,6 +39,7 @@ function Invoke-SqlServerCertificateCommand {
39
39
40
40
# Create a self-signed certificate
41
41
if ($OS -eq " Unix" ) {
42
+ chmod 777 $OutDir
42
43
# Install OpenSSL module
43
44
Install-Module - Name OpenSSL - Repository PSGallery - Force
44
45
# Show version of OpenSSL just to make sure it is installed
@@ -53,16 +54,16 @@ function Invoke-SqlServerCertificateCommand {
53
54
else {
54
55
openssl req - x509 - newkey rsa:4096 - sha256 - days 1095 - nodes - keyout $OutDir / localhostcert.key - out $OutDir / localhostcert.cer - subj " /CN=$fqdn " - addext " subjectAltName=DNS:$fqdn ,DNS:localhost,IP:127.0.0.1,IP:::1"
55
56
}
56
- sudo chmod 777 $OutDir / localhostcert.key $OutDir / localhostcert.cer
57
+ chmod 777 $OutDir / localhostcert.key $OutDir / localhostcert.cer
57
58
# Export the certificate to pfx
58
59
Write-Output " Exporting certificate to pfx..."
59
60
openssl pkcs12 - export -in $OutDir / localhostcert.cer - inkey $OutDir / localhostcert.key - out $OutDir / localhostcert.pfx - password pass:nopassword
60
- sudo chmod 777 $OutDir / localhostcert.pfx
61
+ chmod 777 $OutDir / localhostcert.pfx
61
62
62
63
Write-Output " Converting certificate to pem..."
63
64
# Create pem from cer
64
65
cp $OutDir / localhostcert.cer $OutDir / localhostcert.pem
65
- sudo chmod 777 $OutDir / localhostcert.pem
66
+ chmod 777 $OutDir / localhostcert.pem
66
67
67
68
# Add trust to the pem certificate
68
69
Write-Output " Adding trust to pem certificate..."
@@ -83,7 +84,7 @@ function Invoke-SqlServerCertificateCommand {
83
84
84
85
# enable certificate as CA certificate
85
86
# ---- this causes it to fail in Mac ----
86
- # dpkg-reconfigure ca-certificates
87
+ dpkg- reconfigure ca- certificates
87
88
88
89
# Update the certificates store
89
90
Write-Output " Updating the certificates store..."
0 commit comments