Black Friday Special! Get 30% off Training Subscriptions with code BLACKFRIDAY30 at checkout!

PowerShell PKI Module Documentation

Documentation Home

Test-WebServerSSL

Synopsis

Tests remote web server SSL certificate.

Syntax

Test-WebServerSSL [-URL] <String> [[-Port] <Int32>] [[-Proxy] <WebProxy>] [[-Timeout] <Int32>] [-UseUserContext] [<CommonParameters>]

Description

Tests remote web server SSL certificate. The command connects to the specified web server address, establishes SSL tunnel, retrieves and examines returned certificate.

Parameters

-URL <String>

Specifies a web server address to connect. The address MUST NOT contain a protocol prefix (https://). Only host names are allowed.

Required? True
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-Port <Int32>

Specifies the SSL port to connect. by default, port 443 is used.

Required? False
Position? 1
Default value 443
Accept pipeline input? false
Accept wildcard characters? False

-Proxy <WebProxy>

Specifies a proxy address (including protocol prefix, host name and connection port) if necessary.

Required? False
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? False

-Timeout <Int32>

Specifies the connection timeout in milliseconds. By default 15 seconds (15000 milliseconds) timeout is used.

Required? False
Position? 3
Default value 15000
Accept pipeline input? false
Accept wildcard characters? False

-UseUserContext <SwitchParameter>

Specifies whether to build chain against user store. By default, certificate chain MUST be ended by a Root CA certificate that is stored in the Trusted Root CAs container in Local Machine store.

Required? False
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

None.

Outputs

PKI.Web.WebSSL

Notes

Examples

Example 1

PS C:\> Test-WebServerSSL -URL login.live.com

The command initiates the SSL connection to 'https://login.live.com' on port 443 and examines SSL certificate. Actual SSL certificate is added to the returned object.

Example 2

PS C:\> Test-WebServerSSL -url paypal.com -Proxy "http://proxy.company.com:8080" -Timeout 20000

This command initiates a SSL connection to 'https://paypal.com' on port 443 by using spefied proxy address and examines SSL certificate. The timeout for the connection is 20 seconds (20000 milliseconds). Actual SSL certificate is added to the returned object.

Related links

Minimum PowerShell version support

  • Windows PowerShell 3.0

Operating System Support

  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 11
  • Windows Server 2008 R2 all editions
  • Windows Server 2012 all editions
  • Windows Server 2012 R2 all editions
  • Windows Server 2016 all editions
  • Windows Server 2019 all editions
  • Windows Server 2022 all editions