We should give a hint about what's going on (TLS handshake refused), current error message is a _tad_ too generic:
PS C:\Program Files\PowerShell\6.1.0-preview.1> iwr https://self-signed.badssl.com
iwr : A security error occurred
At line:1 char:1
+ iwr https://self-signed.badssl.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Method: GET, Re...rShell/6.1.0
}:HttpRequestMessage) [Invoke-WebRequest], HttpRequestException
+ FullyQualifiedErrorId :
WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
The problem is that there are like a million causes for this and all we get back from the .NET API is this error message. There could have been a problem with the certificate, with the protocol channel, with trusts, etc. Since we can't get specific due to the underlying API not being specific, we'd have to be pretty generic ourselves.
I'm open to suggestions as to what this error should say.
I'd be OK with the error message if I could run with -Verbose to get more info on what is going on and what stage(s) of connection are failing. Kind of like ssh -vvv. That said, this request probably needs to be made on .NET CoreFx.
@rkeithhill Unfortunately, that is currently unavailable too 鈽癸笍
The limiting factor is CoreFX at this point. I am hoping the new SocketsHttpHandler provides better errors. But I have not yet had a chance to look into it.
This should be filed in DotNet/CoreFx as @markekraus suggests.
Most helpful comment
@rkeithhill Unfortunately, that is currently unavailable too 鈽癸笍
The limiting factor is CoreFX at this point. I am hoping the new
SocketsHttpHandlerprovides better errors. But I have not yet had a chance to look into it.