Search code examples
visual-studiohttpswifgeneva-server

getting Windows Identity Foundation "Developer Training Kit" examples to work


I downloaded the "Developer Training Kit" for Windows Identity Foundation and installed it on a newly set up Windows Server 2008 R2 virtual machine. When I open up the example solutions and press F5 to run them, I get the following error:

"Unable to start debugging on the web server. The underlying connection was closed: An unexpected error occurred on a send."

If I try to start the web page without debugging (Ctrl-F5), I get a "Connection was reset" error in the browser. Nothing works!

The only thing unusual here is that I see that the addresses on the local machine begin with https instead of http as I am used to in my development environment. Has anyone here been able to get these code samples to run?


Solution

  • I found a solution to this here: social.msdn.microsoft.com/....

    There is a bug in the installation script. You have to open the script and make changes with a text editor.

    To quote from the site linked above ( in case it disappears ), make the following change to SetupCertificates.cmd. Replace

    @if ("%IsWinClient%" == "true") (

    ECHO Setting up SSL at port 443 using localhost certificate...

    netsh http add sslcert ipport=0.0.0.0:443 appid={00000000-0000-0000-0000-000000000000} certhash=%CERTHASH% clientcertnegotiation=enable

    ) else (

    ECHO Importing server certificate and point HTTP.SYS at it...

    httpcfg.exe set ssl -i 0.0.0.0:443 -f 2 -h %CERTHASH%

    )

    With

    ECHO Setting up SSL at port 443 using localhost certificate...

    netsh http add sslcert ipport=0.0.0.0:443 appid={00000000-0000-0000-0000-000000000000} certhash=%CERTHASH% clientcertnegotiation=enable