can't post to y webAPI from remote IP adress

shay Avital

Member
Joined
Oct 9, 2020
Messages
12
Programming Experience
Beginner
Hi,

i have my own WEB API that i created with ASP.NET Web Application (.NET Framework).
i have also created a HttpClient and i can post values when i run inside my local network.
when i try the HttpClient on a remote pc , i get :
"SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond myIP:44389"

i have created a port forwarding and mapped it for the right internal IP, but still no success.
i also tried to add bind to my external IP on the applicationhost.config file.
here is a snip from the applicationhost.config:

1638819639784.png


can you please suggest what else i can do?
thanks,

Shay.
 
Solution
Excuse my ignorance but how do i know witch type ssl is my web API has?
When you first installed Visual Studio and created your first web project, VS would have asked you if you wanted to create and install a developer certificate. That cert will be a self-signec cert.

When you visit the URL of your Web API with a browser, right click on the lock or whatever icon the browser uses to indicate that you are using a secure connection. Select the option to show the certificate for the site. Look at the last tab of the property sheet that shows the chain of certificates. If there is only one certificate in the chain, there is a high probability you are using a self-signed cert. One if the other tabs of the property sheet will show...

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
Is port 44389 open on the firewall of your hosting machine?
Does your ISP allow incoming traffic on port 44389?
Does the ISP of the machine running your remote client allow outbound traffic on port 44389?
 

shay Avital

Member
Joined
Oct 9, 2020
Messages
12
Programming Experience
Beginner
Is port 44389 open on the firewall of your hosting machine?
Does your ISP allow incoming traffic on port 44389?
Does the ISP of the machine running your remote client allow outbound traffic on port 44389?
thank you ,
i have cheked it and the port was blocked on my ISP
now i get : " could not establish trust relationship for the ssl/tls secure channel", do you have any idea how to fix it?
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
Well, if you were testing with a self-signed SSL certificate, your options are:
1) Install the same certificate on the client -- HIGHLY NOT RECOMMENDED!!!
2) Install an SSL certificate signed by a real signing authority on the server. RECOMMENDED
3) Use HTTP instead of HTTPS. -- NOT RECOMMENDED for production work
 

shay Avital

Member
Joined
Oct 9, 2020
Messages
12
Programming Experience
Beginner
Well, if you were testing with a self-signed SSL certificate, your options are:
1) Install the same certificate on the client -- HIGHLY NOT RECOMMENDED!!!
2) Install an SSL certificate signed by a real signing authority on the server. RECOMMENDED
3) Use HTTP instead of HTTPS. -- NOT RECOMMENDED for production work
Thank again,
Excuse my ignorance but how do i know witch type ssl is my web API has?
I just followed a guide from csharp corner.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
And the the link to the guide you were using?
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
Excuse my ignorance but how do i know witch type ssl is my web API has?
When you first installed Visual Studio and created your first web project, VS would have asked you if you wanted to create and install a developer certificate. That cert will be a self-signec cert.

When you visit the URL of your Web API with a browser, right click on the lock or whatever icon the browser uses to indicate that you are using a secure connection. Select the option to show the certificate for the site. Look at the last tab of the property sheet that shows the chain of certificates. If there is only one certificate in the chain, there is a high probability you are using a self-signed cert. One if the other tabs of the property sheet will show you deals like who signed the certificate. If the signer looks like your machine name, then you definitely have a self-signed cert.
 
Solution
Top Bottom