Skip to content

Commit df87444

Browse files
committed
Update script that creates certificate.
1 parent 43b940b commit df87444

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/makepfxcert.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function Invoke-SqlServerCertificateCommand {
3939

4040
# Create a self-signed certificate
4141
if ($OS -eq "Unix") {
42+
chmod 777 $OutDir
4243
# Install OpenSSL module
4344
Install-Module -Name OpenSSL -Repository PSGallery -Force
4445
# Show version of OpenSSL just to make sure it is installed
@@ -53,16 +54,16 @@ function Invoke-SqlServerCertificateCommand {
5354
else {
5455
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"
5556
}
56-
sudo chmod 777 $OutDir/localhostcert.key $OutDir/localhostcert.cer
57+
chmod 777 $OutDir/localhostcert.key $OutDir/localhostcert.cer
5758
# Export the certificate to pfx
5859
Write-Output "Exporting certificate to pfx..."
5960
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
6162

6263
Write-Output "Converting certificate to pem..."
6364
# Create pem from cer
6465
cp $OutDir/localhostcert.cer $OutDir/localhostcert.pem
65-
sudo chmod 777 $OutDir/localhostcert.pem
66+
chmod 777 $OutDir/localhostcert.pem
6667

6768
# Add trust to the pem certificate
6869
Write-Output "Adding trust to pem certificate..."
@@ -83,7 +84,7 @@ function Invoke-SqlServerCertificateCommand {
8384

8485
# enable certificate as CA certificate
8586
# ---- this causes it to fail in Mac ----
86-
#dpkg-reconfigure ca-certificates
87+
dpkg-reconfigure ca-certificates
8788

8889
# Update the certificates store
8990
Write-Output "Updating the certificates store..."

0 commit comments

Comments
 (0)