Closed shauncassingham closed 4 years ago
could this be due to the correct IP not being on the white list?
Could maybe also be due to the tls1.2 requirement If so, to get round it in my asp.net project i had to put the following in my global.asax, application_start
protected void Application_Start(object sender, EventArgs e) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; }
What version of .NET are you running, we've had previous people raising a similar issue which was fixed by fixing the TLS to 1.2?
If it's not whitelisted then you'll not be able to access the services too.
Hi folks, thanks for the quick responses. I'm running, .NetFramework 4.5, .NETStandard 1.1 and .NetCore 2.2
Would the whitelist error be different? I'm struggling to find my outwardly facing IP through the firewalls etc.
Does the machine that you're running it on have outbound access to the internet on port 443?
i'll have to check this
I can confirm that running my code on another machine outside of that network produces the expected result. I will work on this issue and report back when I find what the cause is, for future reference.
@shauncassingham thanks for the update!
Trying to use CompanySearch, but coming up with the following error when awaiting the result;
System.AggregateException HResult=0x80131500 Message=One or more errors occurred. (No connection could be made because the target machine actively refused it) Source=System.Private.CoreLib StackTrace: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at CompaniesHouseRequester.Program.Main(String[] args) in
.....\Program.cs:line 102
Inner Exception 1: HttpRequestException: No connection could be made because the target machine actively refused it
Inner Exception 2: SocketException: No connection could be made because the target machine actively refused it