WebClient and proxy server (Ntlm auth maybe?) - proxy

Having some issues connecting to internet from an application where a customer is using a proxy server.
The following code seems to work most other customers, including those that use proxies.
Dim wc As New WebClient
wc.UseDefaultCredentials = True
wc.Proxy = WebRequest.DefaultWebProxy
wc.Proxy.Credentials = wc.Credentials
Dim responseBytes As Byte() = wc.DownloadData("http://www.google.co.uk")
Error is:
System.Net.WebException: The remote
server returned an error: (407) Proxy
Authentication Required.
Previously this same way of connecting did work using their old proxy server, now it doesn't work.
The customer has recently changed proxy server to one that uses NTLM authentication, so I guess this could be the issue.
Any ideas how I should be connecting any differently to above example?
Thanks,
Mike G

Related

SOA Suite 12c OSB routing service to HTTPS basic authentication secured service

I am using Oracle fusion middleware 12.2.1.3.0
I am trying to create basic proxy service to HTTPS basic authentication secured service.
Can anybody explain step by step how to setup business service?
I have tried all combination but all went wrong.
Proxy service is plain with http transport. There is not authentication, security nor policy.
Pipeline is plain too = only routing to business service.
Business service transport protocol http (there are not other options allowed). URI = https://my.uri.com:443/ws/myService?wsdl
Http transport configuration = Authentication Basic, Service account = myAccount.sa (username/password)
No policies.
Business Service Testing gives me "The invocation resulted in an error: Forbidden."
When I supply username/password into testing window it gives me "Error authenticating the transport username/password: [Security:090938]Authentication failure: The specified user failed to log in. javax.security.auth.login.FailedLoginException: [Security:090302]Authentication Failed: User specified user denied"
When I try add oracle/http_basic_auth_over_ssl_client_policy I get "Conflicts found during publish.
[OSB-387194]OWSM Policy 'oracle/http_basic_auth_over_ssl_client_policy' is not allowed since transport authentication is set to 'basic'. If you are trying to attach an HTTP Token Policy make sure that the authentication on transport configuration is set to 'None'. You can either set the authentication mechanism directly on the transport configuration page or attach OWSM HTTP Token Policy."
Any help is appreciated.
Thank you in advance.
You should not add security to BS.
In the Business Configuration tab,put the authentication to 'None' instead of Basic. You should attach security only to Proxy Service and not Business Service.
Hope it helps :)

connect to remote opc server using opc .net api

I'm partly developing opc client application using opc.net api and I have some trouble connecting remote opc server. Below please see the code I wrote to connect to opc server.
Opc. URL url = new Opc. URL ( "opcda://network-pc/some-opc-server" );
Opc.Da. Server server = null ;
OpcCom. Factory fact = new OpcCom. Factory ();
server = new Opc.Da. Server (fact, null );
server.Connect(url, new Opc. ConnectData ( new System.Net. NetworkCredential ()));
After executing this code I am getting error: System.Runtime.InteropServices.ExternalException: CoCreateInstanceEx: Access is denied.
In addition, both computers are in the same local network, and I can connect to opc server from my computer using third party opc clients.
Is there anybody who faced with this kind of issue?
Thanks in advance.
This may not be your C# source code issue.
This could be DCOM permission issue. You have to configure DCOM permission based on your OPC Server guidance for client application.
Following documents for general reference for OPC and DCOM settings
http://www.sytech.com/download/OPC_and_DCOM.pdf
In addition to the answer from Zin Min, make sure that you are on the same domain. As cross domain connections are not possible using OPC-DA, without tunnelling of some kind.

Windows Server 2008 ServerXMLHTTP Proxy

Migrated an applicatoin from Window Server 2003 to Window Server 2008 x64. We have a simple VBS script that goes outside the domain and grabs a XML document using a post request. The script works perfect on Windows Server 2003, however on the new server, we keep getting a status code of 407 (proxy authentication failed). I did verify that I could pull in a file without setting any proxy information from the intranet. Was there any change to the proxy credential methods in Server 2008?
Code Simplified:
Dim o
Set o = CreateObject("Msxml2.ServerXMLHTTP.6.0")
o.open "POST", "https://somesite.com", false
o.setProxy 2, "myproxy:8080", ""
o.setProxyCredentials "user", "pass"
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.send "loginId=USER&password=1234"
While o.readyState <> 4
o.waitForResponse 1000
Wend
Wscript.echo o.status
It does seem the proxy is being contacted, because without it I get server name or address could not be resolved, however the proxy user/password are not being validated correctly, yet work on Window Server 2003.
Edit 20140303: It's been months and I still haven't figured this out. As we look to retire our Windows 2003 machines it's become increasingly important that I figure out what is going wrong.
I noticed if I changed my send data to incorrect UID/PWD I get a response back from the page (the incorrect login page). I don't understand why this works flawlessly on Server 2003 but seems impossible on Server 2008 R2.
If I open up IE on the same box, and use the same proxy information and access the same site with the same UID/PWD it also works. I did this to make sure there wasn't some sort of IP based block where the proxy or site UID/PWD only worked from the old machine.

Sonatype Nexus Professional Proxy Configuration

Our project requires Nexus Professional to store and manage artefacts in a centralized repository hosted on Windows server. We were able to install Sonatype Nexus Professional in Windows workstation. However, I got stuck with Nexus' proxy configuration. A repository of type proxy is not able connect to the proxy server (i.e Proxy Blocked ).
Can some one help with configuration of proxy settings in Sonatype Nexus Professional in Windows?
Regs, Syam
This is HTTP error 407, indicating that your corporate http proxy server requires credentials but either none were supplied or incorrect ones were supplied.
Go to "administration/server" in the Nexus web UI, and configure both "default http proxy settings (optional)", and within that "authentication (optional)".
Most like your server is blocked to connect to the remote server via a proxy server or firewall.
Log into the server as the user running Nexus and confirm that you can ping the remote server first. Most likely that does not work.
Once you have fixed that it will either work or if required you will have to configure Nexus to connect via a proxy. This can be done on a Nexus global level as well as per repository.
I could ping to the https proxy server. We have configured the Proxy settings - Override the HTTP proxy setting of proxy repository configurations.
IAS server requires proxy authentication with error message "Access to the Web Proxy filter is denied". Hope this is due to proxy server configuration.
Error Message says:
Unexpected response code while executing GET method [repositoryId="central", requestPath="/.meta/prefixes.txt", remoteUrl="http://repo1.maven.org/maven2/.meta/prefixes.txt"].
Expected: "SUCCESS (200)". Received: 407 : Proxy Authentication Required
( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
Regards,
Syam
We have made the configuration updates as per your suggestion.
Some how my user credentials is getting locked out due to fact that login attempt failes multiple times at proxy server...
So will have to check with our manager & see if some thing can be done at the proxy server lever to over come the proxy authentication issue.
We will keep you updated. Ultimarly we are plaing for cenralies nexus server

Configure SSL on Windows HTTP server using HTTPAPI_VERSION_1 APIs

I configured SSL on my Windows HTTP server (HTTP listener) developed using HTTPAPI_VERSION_1 APIs using HttpSetServiceConfiguration.
I used a self signed certificate and followed the steps at this link to set it as trusted http://blogs.msdn.com/b/jpsanders/archive/2009/09/29/walkthrough-using-httplistener-as-an-ssl-simple-server.aspx
Then I tried using the sample in msdn named WinHttpPostSample to connect to the http server using https.
But WinHttpSendRequest API always fails with error
12044 (ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED)
How can we prevent the HTTP server from sending this error or to make it not compulsory for the server to have a client certificate to proceed ?

Resources