1

I am currently developing a .net component for the corporate environment. It needed to talk to a 3rd-party company that uses SSH to transfer file. The same component also supports FTP to communicate with different parties.

Everything works fine until I was trying to rely on the WebProxy.IsBypassed method to tell me whether the destination Uri needs to get the proxy server to authenticate.

I have the app.config file settings:

<defaultProxy enabled="true" useDefaultCredentials="true">
    <proxy scriptLocation="http://address/proxy.pac"/>
</defaultProxy>

If the destination Uri was ftp://202.100.1.1:5500, the IsBypassed method correctly returned 'False', which was what I expected. If I changed the same Uri to ssh://202.100.1.1:5500 the IsBypassed method returned 'True'.

I have tested this proxy.pac file, and it worked correctly for both ftp and ssh scenario.

I was wondering does .net actually use this pac file while determine the true or false value for the IsBypassed method?

One thing I notices was, If I typed the address into app.config file, the visual studio would recognize as a link, e.g. ftp://202.100.1.1:5500, then the IsBypassed method can always return the expected result. If I typed ssh://202.100.1.1:5500, the visual studio could not recognize it as a link, then the IsBypassed method always return a false value.

The Stack Overflow also converts the uri with FTP to a link automatically but leave the SSH one as plain text.

Does anyone here has any idea on this?

0 Answers0