I'm using the LogReceiverService
target that comes with NLog to log to a remote logging service. My NLog configuration looks like so:
<target name="loggingservice" type="LogReceiverService" endpointAddress="http://logger:56998/ILoggingService" useBinaryEncoding="False" includeEventProperties="True" />
This works fine. However, if I change the endpointAddress to HTTPS:
<target name="loggingservice" type="LogReceiverService" endpointAddress="https://logger:56998/ILoggingService" useBinaryEncoding="False" includeEventProperties="True" />
Then I get the following WCF exception:
[ArgumentException: The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via]
System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) +17130141
System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannelCore(EndpointAddress remoteAddress, Uri via) +52
System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) +116
System.ServiceModel.Channels.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) +29
System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) +32
System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) +100
System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) +564
System.ServiceModel.ClientBase`1.CreateChannel() +58
System.ServiceModel.ClientBase`1.CreateChannelInternal() +48
System.ServiceModel.ClientBase`1.get_Channel() +464
NLog.LogReceiverService.WcfLogReceiverClient.NLog.LogReceiverService.ILogReceiverClient.BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, Object asyncState) +21
System.ServiceModel.ClientBase`1.InvokeAsync(BeginOperationDelegate beginOperationDelegate, Object[] inValues, EndOperationDelegate endOperationDelegate, SendOrPostCallback operationCompletedCallback, Object userState) +249
I can visit https://logger:56998
in the browser, and it loads just fine after a warning about an untrusted certificate.
I've tried a few of the suggested binding configurations in this post, but none of them make any difference. Plus, none of those answers really explain what's going on, just ideas on how to fix it.