Jump to content

External SSL connections crashing


lsrmax
Go to solution Solved by Knight_Elf,

Recommended Posts

lsrmax

Hello,

 

I'm experiencing crashes on external calls (when identifying a movie, accessing plugins catalog) etc.

The log says : 

 

Error HttpClient: Error getting response from https://www.omdbapi.com.......

*** Error Report ***
Version: 3.4.1.0
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> Interop+Crypto+OpenSslCryptographicException: error:2006D002:BIO routines:BIO_new_file:system lib
 
It seems to have been experienced by other users ( cf https://emby.media/community/index.php?/topic/57167-sometimes-movie-unvailable/ )
 
The only thing that can (maybe) help with diagnosis is that everything was fine until i install Statistics plugin.
 
Thanks.
 
Link to comment
Share on other sites

lsrmax

Sorry about the omission.
Here it is.

2018-06-01 17:44:09.606 Info HttpClient: GET https://www.omdbapi.com?apikey=fe53f97e&plot=full&r=json&s=wonder+woman&type=movie
2018-06-01 17:44:11.213 Error HttpClient: Error getting response from https://www.omdbapi.com?apikey=fe53f97e&plot=full&r=json&s=wonder+woman&type=movie
	*** Error Report ***
	Version: 3.4.1.0
	Command line: /usr/lib/emby-server/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe -restartexitcode 3
	Operating system: Unix 4.16.8.1
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 2
	Program data path: /var/lib/emby
	Application directory: /usr/lib/emby-server
	System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> Interop+Crypto+OpenSslCryptographicException: error:2006D002:BIO routines:BIO_new_file:system lib
	   at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
	   at Internal.Cryptography.Pal.StorePal.LoadMachineStores()
	   at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
	   at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
	   at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.FindCandidates(X509Certificate2 leaf, X509Certificate2Collection extraStore, HashSet`1 downloaded, HashSet`1 systemTrusted, TimeSpan& remainingDownloadTime)
	   at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)
	   at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)
	   at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Security.SslState.ThrowIfExceptional()
	   at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
	   at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
	   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
	   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__47_1(IAsyncResult iar)
	   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
	   --- End of inner exception stack trace ---
	   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
	   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	System.Net.Http.HttpRequestException
	   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
	   at System.Threading.Tasks.ValueTask`1.get_Result()
	   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
	   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	InnerException: Interop+Crypto+OpenSslCryptographicException
	Interop+Crypto+OpenSslCryptographicException: error:2006D002:BIO routines:BIO_new_file:system lib
	   at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
	   at Internal.Cryptography.Pal.StorePal.LoadMachineStores()
	   at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
	   at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
	   at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.FindCandidates(X509Certificate2 leaf, X509Certificate2Collection extraStore, HashSet`1 downloaded, HashSet`1 systemTrusted, TimeSpan& remainingDownloadTime)
	   at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)
	   at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)
	   at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Security.SslState.ThrowIfExceptional()
	   at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
	   at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
	   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
	   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__47_1(IAsyncResult iar)
	   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
	   at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
	   at Internal.Cryptography.Pal.StorePal.LoadMachineStores()
	   at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
	   at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
	   at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.FindCandidates(X509Certificate2 leaf, X509Certificate2Collection extraStore, HashSet`1 downloaded, HashSet`1 systemTrusted, TimeSpan& remainingDownloadTime)
	   at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException)
	   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)
	   at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)
	   at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
	   at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Security.SslState.ThrowIfExceptional()
	   at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
	   at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
	   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
	   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__47_1(IAsyncResult iar)
	   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
Link to comment
Share on other sites

This is still only a snippet, but I would suggest trying it again with the next release of emby server.

 

Note that omdb often has issues on their end so you may still see intermittent failures with that. Thanks.

Link to comment
Share on other sites

lsrmax

The rest of the 15Mo of the log file is only 15Mo of "Info HttpServer: HTTP Response 200 " and "Info HttpServer: HTTP GET".
 

So I have to wait for the next release for being able to check plugin catalog and identify movies ?

 

Thanks

Link to comment
Share on other sites

I don't know why this is happening for you as so far you're the only one reporting it, but yes. The library we depend on to make the http requests has been rewritten and the next release will have that new version included.

Link to comment
Share on other sites

OK, I would suggest trying again with the next release of Emby Server, thanks.

Link to comment
Share on other sites

lsrmax

Hello,

Do you have an idea of the next release date ?

Since i can't get any update news with this SSL problem.

 

Thanks

Link to comment
Share on other sites

Gerrit507

SSL is working for me with 3.4.1.10 beta but stopped working with 3.4.1.12 beta.

 

The cert is from LetsEncrypt converted to pfx.

Log

Link to comment
Share on other sites

zoneee

SSL has stopped working for me too since 3.4.1.12. Tried 3.4.1.14 now and still the same. Attached my emby-server.txt

 

Im also using a LetsEncrypt Cert on Ubuntu 18.04 x86_64. Things have been working great till the change in code from 3.4.1.12. 

 

*   Trying 192.168.46.6...
* TCP_NODELAY set
* Connected to internal_hostname (192.168.46.6) port 8920 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@Strength
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to internal_hostname:8920
* stopped the pause stream!
* Closing connection 0
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to internal_hostname:8920
 
Ive gone back to 3.4.1.11

embyserver.txt

Edited by zoneee
Link to comment
Share on other sites

zoneee

I dont see anything newer than 3.4.1.14 right now.  I already tried that and attached the logfile in my post.

Link to comment
Share on other sites

lsrmax

For my case, it didn't happen on a beta version or an update.
I'm running emby 3.4.1.0 over Archlinux, and no update were made since a few weeks.
I just installed teh "Statistics" plugin, and external https requests dind't work since then.
I tried uninstalling the plugin, downgrading emby, nothing worked...

Link to comment
Share on other sites

Gerrit507

Interesting, I have the Statistics plugin installed too, but for me SSL is working with version 3.4.1.0 stable. It only stops working from Version 3.4.1.12 beta upwards.

 

But I have to say that I already had trouble with SSL and emby in the past, where https access became unavailable after a restart sometimes. This seemed to have fixed in the newer versions, until the most recent ones broke it completely.

Link to comment
Share on other sites

You're mixing two different things here. This topic is about outgoing ssl, which has nothing to do with https becoming unavailable.

 

We have run into some surprises with the upgrade to .net core 2.1 relating to outgoing ssl and that's the reason for the issues. We're still looking into it. I think at this point we've worked it out for all platforms except the debian packages. Thanks.

Link to comment
Share on other sites

Gerrit507

You're mixing two different things here. This topic is about outgoing ssl, which has nothing to do with https becoming unavailable.

 

We have run into some surprises with the upgrade to .net core 2.1 relating to outgoing ssl and that's the reason for the issues. We're still looking into it. I think at this point we've worked it out for all platforms except the debian packages. Thanks.

Well, HTTPS isn't working without SSL!

 

The cause of the both issues I described was probably different but the result is the same: no access over HTTPS!

 

By the way the term "outgoing ssl" doesn't make any sense. SSL is just an encryption protocol, it goes nowhere without a network protocol like https or imaps.

 

No offense but you're getting something wrong here.

Link to comment
Share on other sites

They are two different things. This thread is about Emby Server's ability to contact external websites over https. It's not about anything else. Thanks.

Link to comment
Share on other sites

alucryd

What user are you running emby as? What's his home directory? Do you see a .dotnet folder in it?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...