urielha / log4stash

Module to Log log4net Messages to ElasticSearch
MIT License
60 stars 44 forks source link

Allowing self signed certs does not work (AllowSelfSignedServerCert) #88

Open DmitryMak opened 3 years ago

DmitryMak commented 3 years ago

Running latest log4stash and log4net against a cluster with self signed certificate results in

log4net:ERROR Got error while reading response from ElasticSearch
System.InvalidOperationException: Some error occurred while sending request to ElasticSearch.
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
   at RestSharp.Http.<>c__DisplayClass7_0.<WriteRequestBodyAsync>g__RequestStreamCallback|1(IAsyncResult result)
   at log4stash.ElasticClient.ResponseValidator.CheckResponse(IRestResponse response)
   at log4stash.WebElasticClient.<SafeSendRequestAsync>d__14.MoveNext()
<Server>localhost</Server>
<Port>9200</Port>
<Ssl>true</Ssl>
<AllowSelfSignedServerCert>true</AllowSelfSignedServerCert>

Elastic is installed using default docker compose for amazon/opendistro-for-elasticsearch:1.13.2

danammeansbear commented 4 months ago

did you find out the error for this issue?