I need to determine whether a particular site is accessible on a particular port, given that firewall restrictions exist on the network.
If I cannot access the site on a particular port, then that means I would need to modify the firewall before proceeding. Otherwise, if I can reach the site, then I would be able to proceed with what I intend to do.
I wanted to know whether I could fetch a repository from Github
using the repo's https URL. An example https URL : https://github.com/git-for-windows/git.git
. This can be used with clone
and other tools.
To see whether I could reach Github
and by extension, clone the repo, I ran the following command: Test-NetConnection -ComputerName github.com -Port 443 |findstr "TcpTestSucceeded"
On the system, this command returned the following, indicating that I was able to reach github.com
over port 443 (https).
TcpTestSucceeded : True
However, I then opened up a web browser, and visited https://github.com
, and the web browser indicated that a connection could not be made. https is over port 443 and the domain is github.com
just like what I put in the test.
My questions are:
- Why is there this discrepancy between the two tests?
- How can I accurately test over
CMD
orPowerShell
whether I have access to a particular domain over a particular port?
Clearly, the Test-NetConnection
command did not produce accurate results, as the web browser was not able to reach github.com
.