need help with Powershell. We need to find server certificate expiration using powershell. These are weblogic console Urls. The URLs have context and port like https://server:7020/context . If I browse URL without context, I get error -
Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
I have tried with following code -
Try{
$Conn = New-Object
System.Net.Sockets.TcpClient($WebsiteURL,$WebsitePort)
Try {
$Stream = New-Object
System.Net.Security.SslStream($Conn.GetStream(),$false, {
param($sender, $certificate, $chain, $sslPolicyErrors)
return $true
})
$Stream.AuthenticateAsClient($CommonName)
If I try a server without context it gives following error -
A call to SSPI failed, see inner exception.
What are commands and options to query in powershell? Any help is appreciated.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12