Enabling HTTPS programmatically

Discussion created by rlwatson on Dec 12, 2012
Latest reply on Dec 13, 2012 by rlwatson
I installed Server 10.1 SP1 (with security patch) on a new Windows Server 2012 server.  My code checks the security configuration of ArcGIS Server and then changes it via a POST to http://localhost:6080/arcgis/admin/security/config/update with:

securityEnabled : true
httpEnabled : true
sslEnabled : true

That succeeds.  The next thing I do is to try to POST to https://localhost:6443/arcgis/admin/security/config/updateIdentityStore but recieve the error:

System.Net.WebException: Unable to connect to the remote server
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)

It seems like there is some type of delay here before SSL is actually enabled.  After the error is recieved, SSL is enabled and it works fine.  I think  that the problem relates to timing.  Suggestions?