Actually I’m having problems implementing both HTTPS and compression on the same WCF Web Service, but the problem is easier to explain using BinaryMessageEncoding, and the cause is propably the same.
I have configured both the service and the client like this:
<customBinding>
<binding name="OwnBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding>
<readerQuotas maxDepth="999999999" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="999999999" maxNameTableCharCount="999999999" />
</binaryMessageEncoding>
<httpsTransport maxBufferSize="999999999" maxReceivedMessageSize="999999999" authenticationScheme="Anonymous" proxyAuthenticationScheme="Anonymous" useDefaultWebProxy="true"/>
</binding>
</customBinding>
But it keeps giving me following CommunicationException:
An error occurred while making the HTTP request to https://localhost:8036/Services/FileService. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.
InnerException: {“The underlying connection was closed: An unexpected error occurred on a send.”}
I know it suggest this is due to a invalid sertificate, and I have tried this also with this trick, but it still doesn’t work. (I don’t have a sertificate, and really don’t need one. I just need SSL encryption and compression. No need to authenticate either server or client.
ServiceTraceViewer doesn’t show anything useful either.
You need a server certificate in order to enable HTTPS. This is a requirement since the Transport Level Security (TLS) protocol uses asymmetric cryptography in order to exchange the session key with the client through a secure channel.
You can create a temporary self-signed certificate to use during development and install it in the
CurrentUser\Mystore using the makecert utility:Then, you can easily configure your WCF service to use that certificate using the <serviceCertificate> element in a custom service behavior:
If you’re hosting your service in IIS, you also have to enable SSL on the web site where the service is running before you’ll be able to communicate with it through HTTPS.