Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HttpAddUrl fails with error 183

373 views
Skip to first unread message

jacobpg...@hotmail.com

unread,
Dec 5, 2007, 9:59:21 AM12/5/07
to
Hello

When adding url with https I get error 183 (both port 80 and 443), if
same url is added for http (port 80) there is no error. Error 183 is
"already exists"

Anyone have any idea what's going on? I have yet to call:

HttpSetServiceConfiguration(0, HttpServiceConfigSSLCertInfo,...

Can this be the problem even if the error is weird? Failed to find
any examples of use of HttpSetServiceConfiguration.

Thanks

bent

unread,
Dec 6, 2007, 9:26:38 AM12/6/07
to
I tried to call HttpSetServiceConfiguration but cannot find any useful
documentation on what to fill the structs with.

It would be nice if someone could provide a realworld example.

Code so far:
HTTP_SERVICE_CONFIG_SSL_SET sslSet;
HTTP_SERVICE_CONFIG_SSL_KEY sslKey;
HTTP_SERVICE_CONFIG_SSL_PARAM sslParam;

sockaddr_in addr;
memset(&addr, 0, sizeof(sockaddr_in));
addr.sin_family = AF_INET;
addr.sin_port = htons(listenPort);
addr.sin_addr.s_addr = INADDR_ANY;

sslKey.pIpPort = (sockaddr*)&addr;

sslParam.AppId = appId;
/*
sslParam.DefaultCertCheckMode
sslParam.DefaultFlags
sslParam.DefaultRevocationFreshnessTime
sslParam.DefaultRevocationUrlRetrievalTimeout
sslParam.pDefaultSslCtlIdentifier
sslParam.pDefaultSslCtlStoreName
sslParam.pSslCertStoreName
sslParam.pSslCertStoreName
*/
String8 hash("489ec1b5056992056fa5a029563db7aa06fc53b"); //
thumbprint?
sslParam.pSslHash = (PVOID)hash.c_str();
sslParam.SslHashLength = hash.length();

sslSet.KeyDesc = sslKey; // An HTTP_SERVICE_CONFIG_SSL_KEY structure
that identifies the SSL certificate record.
sslSet.ParamDesc = sslParam; // An HTTP_SERVICE_CONFIG_SSL_PARAM
structure that holds the contents of the specified SSL certificate
record.

return HttpSetServiceConfiguration(0, HttpServiceConfigSSLCertInfo,
&sslSet, sizeof(sslSet), NULL);

Thanks

bent

unread,
Dec 7, 2007, 5:13:31 AM12/7/07
to
It's unclear in the documentation if pSslHash points to a string or a
byte array but I have tried both and still get error code 6 when
calling HttpSetServiceConfiguration

QByteArray hash = HexConverter::fromHex(LnString("48 9e c1 b5 05 69
92 05 6f a5 a0 29 56 3d b7 aa 90 6f c5 3b").upper()); // "certhash
represents the thumbprint of the server certificate" -
http://msdn2.microsoft.com/en-us/library/aa823078.aspx
sslParam.pSslHash = hash.data();
sslParam.SslHashLength = hash.size(); // ULONG

My hope is still that when this functions works, it will stop
HttpAddUrl from failing with error code 183 for https urls.

My I really the only person in the world having problems with this, or
am I pioneering using this api?

Anyone? Thanks

bent

unread,
Dec 11, 2007, 4:29:53 AM12/11/07
to
Is this newsgroup dead?

I got a bit futher I think. Now the urls are added with no error but
when I call HttpSetServiceConfiguration I get an error stating that a
handle is invalid (ERROR_INVALID_HANDLE) (tried calling both before
and after adding urls). This seems to only happen if HttpInitialize is
called with HTTP_INITIALIZE_SERVER as a flag (ofcourse combined with
HTTP_INITIALIZE_CONFIG). With HTTP_INITIALIZE_CONFIG alone there is no
error returned.

Am I really the only person ever to try to use SSL with this api or
just the only one having problems with it?

tel.920...@gmail.com

unread,
Jul 19, 2013, 4:49:43 AM7/19/13
to
In documentation wrotes that you can yous init server and init config both. Just wrie 3 for param
(HTTP_INITIALIZE_CONFIG|HTTP_INITIALIZE_SERVER)
0 new messages