[Carbon] Re: Carbon Test-SslCertificateBinding Error

  • From: Aaron Jensen <aaron@xxxxxxxxxxxxxxxxxx>
  • To: Sascha Haupt <sh@xxxxxxxxxx>, carbon@xxxxxxxxxxxxx
  • Date: Mon, 9 Nov 2015 10:11:10 -0800

I see what the problem is. Looks like the output of the netsh command to
get SSL certificate bindings is localized. On your system, it gets output
in Germain [1]. On my computer, in English [2]. And, Carbon parses based on
English labels. :-(

Unfortunately, there isn't a viable workaround (switching your OS to
English is not viable, in my opinion). The solution is to use the Win32
HTTP API to get this information, which doesn't depend on netsh output.
I've created issue #171: Get-SslCertificateBinding Fails When Culture Is
Not en-US
<https://bitbucket.org/splatteredbits/carbon/issues/171/get-sslcertificatebinding-fails-when-os>
to
get this fixed.

In the meantime, you'll have to write your own version that work in German.
:-(



[1]
SSL-Zertifikatbindungen:
-------------------------

IP:Port : 0.0.0.0:443
Zertifikathash : 7b8d5b66d1c2de0eb6f27ee57fb47d19bc42b82c
Anwendungs-ID : {4dc3e181-e14b-4a21-b022-59fc669b0914}
Zertifikatspeichername : MY
Clientzertifikatsperre überprüfen : Enabled
Zur Sperrüberprüfung ausschließlich zwischengespeichertes
Clientzertifikat verwenden : Disabled
Verwendungsüberprüfung : Enabled
Sperraktualisierungszeit : 0
Zeitlimit für URL-Abruf : 0
Steuerelement-ID : (null)
Steuerelement-Speichername : (null)
DS-Zuordnungsverwendung : Disabled
Clientzertifikat aushandeln : Disabled


[2]
SSL Certificate bindings:
-------------------------

IP:port : 0.0.0.0:4
Certificate Hash : e156b7f3aec986fc7056ff79bc774b8344f61d55
Application ID : {6dc6b7b9-7714-45d3-b075-eb911d38cb1d}
Certificate Store Name : (null)
Verify Client Certificate Revocation : Enabled
Verify Revocation Using Cached Client Certificate Only : Disabled
Usage Check : Enabled
Revocation Freshness Time : 0
URL Retrieval Timeout : 0
Ctl Identifier : (null)
Ctl Store Name : (null)
DS Mapper Usage : Disabled
Negotiate Client Certificate : Disabled



On Sun, Nov 8, 2015 at 11:22 PM, Sascha Haupt <sh@xxxxxxxxxx> wrote:

Thanks for you fast reply,



The code is really simple, because the only thing I want to do is checking
if a certain binding exists and log that into a textfile.

Here’s the code without logging and only displaying in powershell:



Set-ExecutionPolicy -Scope LocalMachine Unrestricted

try

{



$Binding = Test-SslCertificateBinding -ErrorAction Stop



if($Binding = $null)

{

Write-Host "NULL"

}

else

{

Write-Host "NOTNULL"

}

}

catch

{

Write-Host $_.Exception.Message

write-host $Error[0].ScriptStackTrace

}



$Error[0].ScriptStackTrace tells me the error occurs at line 5. Means

$Binding = Test-SslCertificateBinding -ErrorAction Stop





The result of netsh http show sslcert are attatched.



Thanks for your help.



Greetings

Sascha



*Von:* Aaron Jensen [mailto:aaron@xxxxxxxxxxxxxxxxxx]
*Gesendet:* Freitag, 6. November 2015 16:17
*An:* carbon@xxxxxxxxxxxxx; Sascha Haupt
*Betreff:* Re: [Carbon] Carbon Test-SslCertificateBinding Error



Unfortunately the Test-SslCertificateBinding I would like to use causes an
error.
This is the error message I get (translated from german) when only typing
Test-SslCertificateBinding into the powershell :
“The argument “3” with value “” for "SslCertificateBinding" cannot be
converted to the type “System.Guid” :”NULL cannot be converted to the type
“System.Guid”


Can you send the code that is causing this error? You can use
$Error[0].ScriptStackTrace to see what line the error is occurring on,
where 0 is the index of the exception/error in the $Error array.



Looking at the code, it seems one of your bindings doesn’t have an
application ID. Can you send me the output of this command?



> netsh http show sslcert





Other related posts: