yar229 / WebDavMailRuCloud

WebDAV cloud.mail.ru ...& Yandex.Disk | WebDAV Облако Mail.Ru Сетевой Диск

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux: CERTIFICATE_VERIFY_FAILED

powerman opened this issue · comments

$ mono wdmrc.exe -p 10801
  WebDAVCloudMailRu: WebDAV emulator for Cloud.Mail.ru
  v.1.0.0.0
  yar229@yandex.ru
[1]: WebDAV server running at http://127.0.0.1:10801
[Threadpool worker]: OPTIONS:http://127.0.0.1:10801/:127.0.0.1:10801 - Start processing
[Threadpool worker]: OPTIONS:http://127.0.0.1:10801/:127.0.0.1:10801 - Finished processing (5ms, HTTP result: 200)
[Threadpool worker]: PROPFIND:http://127.0.0.1:10801/:127.0.0.1:10801 - Start processing
[Threadpool worker]: Unexpected exception while handling request (method=PROPFIND, url=http://127.0.0.1:10801/, source=127.0.0.1:10801
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Net.WebException: Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED) ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
  at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00054] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncProtocolRequest asyncRequest, Mono.Net.Security.AsyncOperationStatus status) [0x00033] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (Mono.Net.Security.AsyncOperationStatus status) [0x00086] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation () [0x0000d] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.StartOperation () [0x00000] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) [0x00083] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x0000c] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.Private.MonoSslStreamWrapper.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00006] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0006a] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetRequestStream (System.IAsyncResult asyncResult) [0x00043] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0+<LoginAsync>c__AnonStorey3.<>m__0 (System.IAsyncResult asyncResult) [0x00000] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00034] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0+<LoginAsync>c__AnonStorey3+<LoginAsync>c__async7.MoveNext () [0x0002b] in <444b1faad6f2414e951b3e73e5f5f738>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0.MoveNext () [0x00255] in <444b1faad6f2414e951b3e73e5f5f738>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00034] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at MailRuCloudApi.Api.Account.Login () [0x00006] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at MailRuCloudApi.Api.CloudApi..ctor (System.String login, System.String password) [0x00025] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at MailRuCloudApi.MailRuCloud..ctor (System.String login, System.String password) [0x00006] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at MailRuCloudApi.SplittedCloud..ctor (System.String login, System.String password) [0x00000] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at YaR.WebDavMailRu.CloudStore.Cloud.Instance (NWebDav.Server.Http.IHttpContext context) [0x0007a] in <a7851a6f54294ea7b224efa6a12e7c33>:0 
  at YaR.WebDavMailRu.CloudStore.Mailru.StoreBase.MailruStore.GetItemAsync (System.Uri uri, NWebDav.Server.Http.IHttpContext httpContext) [0x00013] in <a7851a6f54294ea7b224efa6a12e7c33>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at NWebDav.Server.WebDavDispatcher+<DispatchRequestAsync>d__6.MoveNext () [0x00278] in <5ab6ccfea3fe4f38a303c342958d9422>:0 
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Net.WebException: Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED) ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
  at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00054] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncProtocolRequest asyncRequest, Mono.Net.Security.AsyncOperationStatus status) [0x00033] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (Mono.Net.Security.AsyncOperationStatus status) [0x00086] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation () [0x0000d] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.StartOperation () [0x00000] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) [0x00083] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x0000c] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.Private.MonoSslStreamWrapper.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00006] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0006a] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetRequestStream (System.IAsyncResult asyncResult) [0x00043] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0+<LoginAsync>c__AnonStorey3.<>m__0 (System.IAsyncResult asyncResult) [0x00000] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00034] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0+<LoginAsync>c__AnonStorey3+<LoginAsync>c__async7.MoveNext () [0x0002b] in <444b1faad6f2414e951b3e73e5f5f738>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0.MoveNext () [0x00255] in <444b1faad6f2414e951b3e73e5f5f738>:0 
---> (Inner Exception #0) System.Net.WebException: Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED) ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
  at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00054] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncProtocolRequest asyncRequest, Mono.Net.Security.AsyncOperationStatus status) [0x00033] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (Mono.Net.Security.AsyncOperationStatus status) [0x00086] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation () [0x0000d] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.AsyncProtocolRequest.StartOperation () [0x00000] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Net.LazyAsyncResult lazyResult) [0x00083] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x0000c] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.Private.MonoSslStreamWrapper.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00006] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0006a] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetRequestStream (System.IAsyncResult asyncResult) [0x00043] in <112fe6c9f3ff420c883a0e57e81d2368>:0 
  at MailRuCloudApi.Api.Account+<LoginAsync>c__async0+<LoginAsync>c__AnonStorey3.<>m__0 (System.IAsyncResult asyncResult) [0x00000] in <444b1faad6f2414e951b3e73e5f5f738>:0 
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00014] in <12e050e5b3d34326a1b4e2e7624e75da>:0 <---
<---

I'm using Gentoo Linux, and I've tried mono 4.4.1.0 and 4.8.0.459 (same error on both).

I'm using minimal mono build (disables, for example, plugins, fonts, most drivers, non-critical features) and no extras (like Visual Basic .NET Runtime and Class Libraries), but at a glance it doesn't looks like an issue with absent mono features, but instead it's something with https/openssl/root certificates.

Which https hosts you're connecting to? I can try to manually connect these hosts using wget/curl to check how openssl works without involving mono in this debugging process.

commented

I'm quite a noob in Linux, but, as far as I know, on some distributives you must import certificates to mono storage, something like this

Check
https://cloud.mail.ru
https://auth.mail.ru
and, for example, https://cloclo21.datacloudmail.ru/

Yeah, this helps, thanks!

# cat /etc/ssl/certs/* >ca-bundle.crt
# cert-sync ca-bundle.crt
# rm ca-bundle.crt