You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After update artifacts 7168, http requests in C# throw error
in this example, the same script work on 7166 but on 7168 throw the follow error:
[ script:dll] Erro (https://restcountries.com/v3.1/name/portu): An error occurred while sending the request
[ script:dll]
[ script:dll] Erro (https://restcountries.com/v3.1/name/portu): at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00476] in <0c97a591a0114a30937001a943b2c9ac>:0
[ script:dll] at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x000ca] in <0c97a591a0114a30937001a943b2c9ac>:0
[ script:dll] at MyResource.Server.servermy.Get (System.String url) [0x00106] in <6c64857ecdba48eb8af110f65ef0fd4a>:0
[ script:dll]
[ script:dll] Erro (https://restcountries.com/v3.1/name/portu): System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
[ script:dll] at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x00037] in :0
[ script:dll] at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in :0
[ script:dll] at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in :0
[ script:dll] Exception_EndOfInnerExceptionStack
[ script:dll] at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00032] in :0
[ script:dll] at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in :0
[ script:dll] Exception_EndOfInnerExceptionStack
[ script:dll] at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x0004b] in :0
[ script:dll] at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x0000e] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in :0
[ script:dll] --- End of stack trace from previous location where exception was thrown ---
[ script:dll]
[ script:dll] at Mono.Net.Security.MonoTlsStream.CreateStream (System.Net.WebConnectionTunnel tunnel, System.Threading.CancellationToken cancellationToken) [0x00126] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] at System.Net.WebConnection.CreateStream (System.Net.WebOperation operation, System.Boolean reused, System.Threading.CancellationToken cancellationToken) [0x001ba] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] Exception_EndOfInnerExceptionStack
[ script:dll] at System.Net.WebConnection.CreateStream (System.Net.WebOperation operation, System.Boolean reused, System.Threading.CancellationToken cancellationToken) [0x0021a] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00141] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] at System.Net.WebOperation.Run () [0x0009a] in <42f584362443417994ec5d5c4e2c6478>:0
[ script:dll] at System.Net.WebCompletionSource1[T].WaitForCompletion () [0x00094] in <42f584362443417994ec5d5c4e2c6478>:0 [ script:dll] at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in <42f584362443417994ec5d5c4e2c6478>:0 [ script:dll] at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00020] in <42f584362443417994ec5d5c4e2c6478>:0 [ script:dll] at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in :0
[ script:dll] --- End of stack trace from previous location where exception was thrown ---
[ script:dll]
[ script:dll] at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0041b] in <0c97a591a0114a30937001a943b2c9ac>:0
[ script:dll]
Resource example:
Expected result
request must return data from the api
Reproduction steps
Create Server Resource with this script and run on artifacts 7168 to catch error or artifacts 7166 to sucess.
public class servermy : BaseScript
{
public servermy()
{
RegisterCommand("teste", new Action<int, List<object>, string>(async (source, args, raw) =>
{
await this.Get("https://restcountries.com/v3.1/name/portu");
}), false);
}
public async Task Get(string url)
{
using (var client = new HttpClient())
{
client.Timeout = TimeSpan.FromSeconds(10);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Add("Accept", "*/*");
var result = string.Empty;
try
{
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
var req = await client.GetAsync(url);
result = await req.Content.ReadAsStringAsync();
Debug.WriteLine($"result ({url}): {result}");
}
catch (Exception ex)
{
Debug.WriteLine($"\n\tErro ({url}): {ex.Message}");
Debug.WriteLine($"\n\tErro ({url}): {ex.StackTrace}");
Debug.WriteLine($"\n\tErro ({url}): {ex.InnerException}");
}
};
}
}
Importancy
Unknown
Area(s)
FiveM, FXServer, ScRT: C#
Specific version(s)
Server 7168 or greater
Additional information
No response
The text was updated successfully, but these errors were encountered:
Hi! Thanks for bringing this to our attention. I was able to find the root cause of this issue and I have a fix ready locally. Will do my best to get it out soon :)
What happened?
After update artifacts 7168, http requests in C# throw error
in this example, the same script work on 7166 but on 7168 throw the follow error:
Resource example:
Expected result
request must return data from the api
Reproduction steps
Create Server Resource with this script and run on artifacts 7168 to catch error or artifacts 7166 to sucess.
Importancy
Unknown
Area(s)
FiveM, FXServer, ScRT: C#
Specific version(s)
Server 7168 or greater
Additional information
No response
The text was updated successfully, but these errors were encountered: