Hi There,
Here is the error with stacktrace...
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> System.ArgumentException: Decoded string is not a valid IDN name.
Parameter name: unicode
at System.Globalization.IdnMapping.GetAsciiCore(String unicodeString, Char* unicode, Int32 count)
at System.Globalization.IdnMapping.GetAscii(String unicode, Int32 index, Int32 count)
at Interop.OpenSsl.AllocateSslContext(SslProtocols protocols, SafeX509Handle certHandle, SafeEvpPKeyHandle certKeyHandle, EncryptionPolicy policy, SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
--- End of inner exception stack trace ---
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
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.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.BeginAuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__47_0(SslClientAuthenticationOptions arg1, CancellationToken arg2, AsyncCallback callback, Object state)
at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)
at System.Net.Security.SslStream.AuthenticateAsClientAsync(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken)
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.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at YoutubeExplode.Internal.HttpClientEx.HeadAsync(HttpClient client, String requestUri)
at YoutubeExplode.YoutubeClient.GetVideoMediaStreamInfosAsync(String videoId)
at AudioChord.Processors.YouTubeProcessor.ProcessAudioAsync() in C:\Users\ComputerMaster1st\Documents\GitHub\RailgunVB\Shared.Music\src\AudioChord\Processors\YouTubeProcessor.cs:line 45
at AudioChord.Collections.SongCollection.DownloadFromYouTubeAsync(String url) in C:\Users\ComputerMaster1st\Documents\GitHub\RailgunVB\Shared.Music\src\AudioChord\Collections\SongCollection.cs:line 113
at AudioChord.MusicService.DownloadSongFromYouTubeAsync(String url) in C:\Users\ComputerMaster1st\Documents\GitHub\RailgunVB\Shared.Music\src\AudioChord\MusicService.cs:line 144
at RailgunVB.Music.MusicPlay.Url(String Input) in C:\Users\ComputerMaster1st\Documents\GitHub\RailgunVB\RailgunVB\RailgunVB\Command\Music\MusicPlay.vb:line 139
This occurred after upgrading to .NETCore 2.1
Perhaps related to #109
Try downgrading to .NET Core 2.0
Unable to downgrade due to another package I use breaks with 2.0.
EDIT: The sockets in 2.1 are needed for it to function.
Create new project.
I have no idea why this happens but this is an issue that appears only on .NET Core 2.1 preview, afaik.
Allow me to rephrase that...
The package I use which can only work on 2.1 is Discord.Net (Discord changed voice infrastructure for one region and requires 2.1 to function correctly).
The problem with YE is found on HttpClientEx Line 35
This is not YE issue, this is an issue with new HttpClient on .Net Core 2.1 SDK preview which is not supported. If you can't downgrade to netstandard2.0 you could try reverting HttpClient to an old one. How to do this is written here: https://blogs.msdn.microsoft.com/dotnet/2018/04/11/announcing-net-core-2-1-preview-2/
Where should this "AppContext" code be written?
Sorted.
Can the issue be closed?
-Case Closed-
was this issue fixed ?
Hi There,
This issue has been fixed since NETCore 3 was released.