Skip to content

Commit a33bb45

Browse files
NO-SNOW add Windows (powershell) method of checking CRL endpoint (#1069)
1 parent 4c44f1f commit a33bb45

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

doc/CertficateValidation.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,57 @@ Example output:
6666

6767
Please repeat the same for all the Snowflake-related endpoints from step 1.
6868

69+
For Windows if you do not wish to download additional tools, you can also use the existing Powershell facility. Please find the below Powershell script as a simplistic example of a possible approach. In this example, you would put below contents into `checkCrl.ps1` script:
70+
```ps
71+
if ( $($args.Count) -ne 1 ) {
72+
Write-Output "Please use the full name of your Snowflake account as an argument."
73+
Write-Output "Example: powershell .\checkCrl.ps1 xy12345.eu-central-1.snowflakecomputing.com"
74+
exit 1
75+
}
76+
$sfaccount = $args[0]
77+
$Connection = [System.Net.HttpWebRequest]::Create('https://' + $sfaccount)
78+
$Response = $Connection.GetResponse()
79+
$Response.Dispose()
80+
$Certificate = $Connection.ServicePoint.Certificate
81+
$Chain = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Chain
82+
$Chain.build($Certificate)
83+
$Chain.ChainElements.Certificate | % {set-content -value $($_.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)) -encoding byte -path "$pwd\$($_.Thumbprint).sf.cer"}
84+
Get-ChildItem *.sf.cer | ForEach-Object { certutil $_ | Select-String -Pattern "Subject:" -Context 1 ; certutil $_ | Select-String -Pattern "Distribution Point Name" -Context 2 }
85+
Remove-Item *.sf.cer
86+
```
87+
88+
After saving it, you can run it with specifying your Snowflake account's full name. An example execution and output, for a Snowflake account located in GCP US Central region:
89+
```shell
90+
c:\temp>powershell .\checkCrl.ps1 xy12345.us-central1.gcp.snowflakecomputing.com
91+
True
92+
93+
94+
> Subject:
95+
CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1
96+
CRL Distribution Points
97+
[1]CRL Distribution Point
98+
> Distribution Point Name:
99+
Full Name:
100+
URL=http://crl3.digicert.com/DigiCertGlobalRootG2.crl
101+
102+
> Subject:
103+
CN=*.us-central1.gcp.snowflakecomputing.com
104+
CRL Distribution Points
105+
[1]CRL Distribution Point
106+
> Distribution Point Name:
107+
Full Name:
108+
URL=http://crl3.digicert.com/DigiCertGlobalG2TLSRSASHA2562020CA1-1.crl
109+
[2]CRL Distribution Point
110+
> Distribution Point Name:
111+
Full Name:
112+
URL=http://crl4.digicert.com/DigiCertGlobalG2TLSRSASHA2562020CA1-1.crl
113+
114+
> Subject:
115+
CN=DigiCert Global Root G2
116+
```
117+
118+
Look for values of `URL` fields under `Distribution Point Name` sections.
119+
69120
3. **Ensure (or work with your systems / network / cloud team to ensure) the CRL endpoints from step 2 are reachable from the _same host/network, over port 80_, on which host/network your application is running, which application is using the Snowflake .NET driver**
70121

71122
If your network includes any proxies through which the connection is sent, do make sure those proxies allow the connectivity to the CRL endpoints over port 80.

0 commit comments

Comments
 (0)