RabbitMQ with SSL: None of the specified endpoints were reachable - c#

I followed this tutorial link and installed Rabbit MQ on Oracle Cloud server. I am able to use Management Plugin in browser. But when I try to push a message via dotnet I am getting this error. Firewall is allowed for ports 5671,5672 and 15672 also in oracle ingress rules."
"RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the
specified endpoints were reachable\r\n ---> System.AggregateException:
One or more errors occurred. (Connection failed)\r\n --->
RabbitMQ.Client.Exceptions.ConnectFailureException: Connection
failed\r\n ---> System.Net.Sockets.SocketException (11001): No such
host is known.\r\n at
System.Net.NameResolutionPal.ProcessResult(SocketError errorCode,
GetAddrInfoExContext* context)\r\n at
System.Net.NameResolutionPal.GetAddressInfoExCallback(Int32 error,
Int32 bytes, NativeOverlapped* overlapped)\r\n--- End of stack trace
from previous location ---\r\n at
RabbitMQ.Client.Impl.TcpClientAdapter.ConnectAsync(String host, Int32
port)\r\n at RabbitMQ.Client.Impl.TaskExtensions.TimeoutAfter(Task
task, TimeSpan timeout)\r\n at
RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient
socket, AmqpTcpEndpoint endpoint, TimeSpan timeout)\r\n --- End of
inner exception stack trace ---\r\n at
RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient
socket, AmqpTcpEndpoint endpoint, TimeSpan timeout)\r\n at
RabbitMQ.Client.Impl.SocketFrameHandler.ConnectUsingAddressFamily(AmqpTcpEndpoint
endpoint, Func2 socketFactory, TimeSpan timeout, AddressFamily family)\r\n at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan connectionTimeout, TimeSpan
readTimeout, TimeSpan writeTimeout)\r\n at
RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint
endpoint)\r\n at
RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver
resolver, Func2 selector)\r\n --- End of inner exception stack trace ---\r\n at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector)\r\n at
RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver
endpoints)\r\n at
RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver
endpointResolver, String clientProvidedName)\r\n --- End of inner
exception stack trace ---\r\n at
RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver
endpointResolver, String clientProvidedName)\r\n at "
when trying to run rabbitmq-diagnostics listeners I am getting this error in logs
** Connection attempt from node '' rejected. Invalid challenge reply. **
Can anyone assist me on this issue?

Related

gRPC connect to Concordium blockchain API with C#

I realize that this a rather service specific subject, but I think that the reason for my problem is a general one, since I'm a novice in the gRPC arena.
I'm attempting to call a simple method PeerVersion in the Concordium blockchain gRPC API (https://github.com/Concordium/concordium-grpc-api) from a .NET Core 3.1 app, but I get what seems to be a rather general error in regard to SSL.
I can add that I have testet this call and others with BloomRPC (https://github.com/uw-labs/bloomrpc) and it works just fine.
You wont be able to call the API successfully without access to a Concordium node, but I recon that someone with better insight into gRPC than me, could maybe see what I'm doing wrong.
C# code
static async Task Main(string[] args)
{
using var channel = GrpcChannel.ForAddress("https://192.168.1.18:10001"); // my local node running on the Concordium testnet
var client = new Concordium.P2P.P2PClient(channel);
var metadata = new Grpc.Core.Metadata() // required token for the API
{
{ "authentication", "rpcadmin" }
};
var request = new Concordium.Empty();
var reply = client.PeerVersion(request, metadata);
Console.WriteLine("peer version: " + reply.Value);
Console.WriteLine("press any key to exit...");
Console.ReadKey();
}
When I run this I get the following exception. (Danish text reads "An existing connection was forcibly disconnected by an external host" or something like that).
- $exception {"Status(StatusCode=\"Unavailable\", Detail=\"Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException: Unable to read data from the transport connection: En eksisterende forbindelse blev tvangsafbrudt af en ekstern vært.. SocketException: En eksisterende forbindelse blev tvangsafbrudt af en ekstern vært.\", DebugException=\"System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.IO.IOException: Unable to read data from the transport connection: En eksisterende forbindelse blev tvangsafbrudt af en ekstern vært..
---> System.Net.Sockets.SocketException (10054): En eksisterende forbindelse blev tvangsafbrudt af en ekstern vært.
--- End of inner exception stack trace ---
at System.Net.FixedSizeReader.ReadPacketAsync(Stream transport, AsyncProtocolRequest request)
at System.Net.Security.SslStream.ThrowIfExceptional()
at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__65_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.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)\")"} Grpc.Core.RpcException
Is anyone able to give me some pointers as to what could be the problem here?
For anyone that knows BloobRPC, here is a screenshot of request and response.
Ah, I got the answer to my problem elsewhere. It turns out that my assumption that the Concordium node requires a secure connection was wrong, in fact it doesn't support secure connections, so the URL was the wrong part.
So to fix the problem, I needed to create the client like this:
// to allow non secure connections
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
using var channel = GrpcChannel.ForAddress("http://192.168.1.18:10001");

iam getting this error 28000: no pg_hba.conf entry for host "XXX.xx.xx.192" while applying migrations in .Net Core Project

I'm Getting This Error While Applying Migrations To Create New Database Hosted in database Cluster in Digitalocean.
my connection string is:
var conn = "User ID=test;Password=testPassword;Server=db-postgresql-tor1-xxxxx-do-user-xxxxxxxxx-0.b.db.ondigitalocean.com;port=25060;Database=TestAuthentication;Integrated Security=false;Pooling=true;";
Npgsql.PostgresException (0x80004005): 28000: no pg_hba.conf entry for host "XXX.xx.xx.192", user "test", database "TestAuthentication", SSL off
at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 933
--- End of stack trace from previous location ---
at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 973
--- End of stack trace from previous location ---
at Npgsql.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.Auth.cs:line 22
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 389
at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<g__OpenLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnection.cs:line 240
--- End of stack trace from previous location ---
at Npgsql.NpgsqlConnection.Open() in C:\projects\npgsql\src\Npgsql\NpgsqlConnection.cs:line 119
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Exception data:
Severity: FATAL
SqlState: 28000
MessageText: no pg_hba.conf entry for host "XXX.xx.xx.192", user "test", database "TestAuthentication", SSL off
File: auth.c
Line: 496
Routine: ClientAuthentication
28000: no pg_hba.conf entry for host "XXX.xx.xx.192", user "test", database "TestAuthentication", SSL off
That's a PostgreSQL error. You are trying to access a database in another computer but the client is not authorised by the server. If you have access to the server, you can edit the pg_hba.conf file and add an entry to XXX.xx.xx.192. There are plenty of examples in the same file.

GetStringAsync fails when IIS Binding set to specific IP

I have an issue with my app communicating with a website, but only when the bindings are set to use a Specific IP (i.e., 172.16.9.86). If I leave the binding as '*' (All Unassigned) the app works correctly.
The app is making the call to the website using HttpClient (.NET Core 3.1) like so:
try
{
System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
responseBody = await client.GetStringAsync("https://myServer.myDomain.com/SecureKeyTest/rdTemplate/rdGetSecureKey.aspx?Username=admin");
Debug.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Debug.WriteLine("Message :{0} ", e.Message);
}
I can take that same URL and paste it into Chrome and it works to retrieve the SecureKey, even when the binding is still set to a specific IP address, so I don't understand how the HttpClient call is different from the call from Chrome.
I have scoured hundreds of posts I have found on this issue and almost all claim that adding the SecurityProtocol settings is supposed to fix this issue, but it hasn't. The certificate used for this website is a fully registered company certificate, not a self-generated one.
EDIT: forgot to add the exception message I get:
The SSL connection could not be established, see inner exception.System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
--- End of inner exception stack trace
--- at System.Net.FixedSizeReader.ReadPacketAsync(Stream transport, AsyncProtocolRequest request) at System.Net.Security.SslStream.ThrowIfExceptional() at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__65_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)
Simply because you don't have a corresponding IP based certificate mapping for that IP address in Windows HTTP API,
https://docs.jexusmanager.com/tutorials/https-binding.html#ip-based-bindings

Just installed ngx-bootstrap and now getting Kestral error when running

Just wondering if I could have some help with something. I'm just working on my first Angular project and following a tutorial. I have just had to uninstall and re install part of Angular for downloading ngx-bootstrap as it wasn't working. That has now been successful but when I go to run the program I get the following error.
crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.IO.IOException: Failed to bind to address https://127.0.0.1:5001: address already in use.
---> Microsoft.AspNetCore.Connections.AddressInUseException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
---> System.Net.Sockets.SocketException (10048): Only one usage of each socket address (protocol/network address/port) is normally permitted.
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.<Bind>g__BindSocket|13_0(<>c__DisplayClass13_0& )
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.<Bind>g__BindSocket|13_0(<>c__DisplayClass13_0& )
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.<>c__DisplayClass29_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.LocalhostListenOptions.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
Unhandled exception. System.IO.IOException: Failed to bind to address https://127.0.0.1:5001: address already in use.
---> Microsoft.AspNetCore.Connections.AddressInUseException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
---> System.Net.Sockets.SocketException (10048): Only one usage of each socket address (protocol/network address/port) is normally permitted.
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.<Bind>g__BindSocket|13_0(<>c__DisplayClass13_0& )
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.<Bind>g__BindSocket|13_0(<>c__DisplayClass13_0& )
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.<>c__DisplayClass29_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at API.Program.Main(String[] args) in C:\Users\Curtis.Holt\Desktop\DatingApp080221\api\Program.cs:line 16
Any help would be greatly appreciated.
Regards
If anyone else is experiencing this - nice simple fix (reboot your pc)

.NET Core call WCF: The server name or address could not be resolved error

I've a .NET Core 2 web api that call a connected WCF service. In my development environment it works fine, but when I deploy it in production environment, with IIS and Kestrel, I get this exception:
System.AggregateException: One or more errors occurred. (There was no endpoint listening at http://192.168.100.33:3433/Test.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.) ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://192.168.100.33:3433/Test.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The server name or address could not be resolved
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.ServiceModelHttpMessageHandler.<SendAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.<SendRequestAsync>d__13.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at WebApplication1.Controllers.ValuesController.Get() in c:\temp\TestWS\WebApplication1\Controllers\ValuesController.cs:line 29
---> (Inner Exception #0) System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://192.168.100.33:3433/Test.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The server name or address could not be resolved
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.ServiceModelHttpMessageHandler.<SendAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.<SendRequestAsync>d__13.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)<---
The same WCF service called by classic web api on the same server works fine.
If I call it by web browser from the server it work fine too.
This is my test code:
BasicHttpBinding bindingStr = new BasicHttpBinding();
EndpointAddress endpointSessionSTR = new EndpointAddress(new Uri("http://192.168.100.33:3433/Test.svc"));
TestStrutture.StruttureClient cliStr = new TestStrutture.StruttureClient(bindingStr, endpointSessionSTR);
var retVal = cliStr.GetClassiStrutturaAsync();
retVal.Wait();
var classi = retVal.Result;
What did I forget to do?
On CMD:
netsh winhttp reset proxy
You can try to list the proxys first using.
netsh winhttp show proxy
I have not discovered why this happens, but that did the trick for me. On netcore 2.0 and 2.1.

Categories

Resources