Httpurlconnection and Proxy settings

hi all,
I wrote a servlet that uses an HTTPUrlConnection to get a page from a remote server and the code looks like this :
url = new URL(urlstr);
HttpURLConnection uc = null;
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "[myproxyhost]");
System.getProperties().put( "proxyPort", "[myproxyport]);          
uc = (HttpURLConnection) url.openConnection();
The code works fine for the particular connection.
If I need to get another page though another connection that needs no Proxy settings, it doesn't work.
How can I deactivate the proxy settings between the two connections?
And, finally, how can I leave the System settings in the same state as before the code execution?
Thank you.
Nicola

You could trySystem.getProperties().put( "proxySet", "false" );to temporarily turn off the proxy settings. Or you could trySystem.getProperties().remove( "proxySet");
// and the other two similarlyto remove those system properties.

Similar Messages

  • Itunes and proxy settings. Itunes keeps the proxy setting from IE and I can't adapt it due to company policy. How can I force itunes to use firefox?

    itunes can not connect to server and I can't find its proxy settings.
    So I think it uses these from IE and those are blocked by company policy.
    So, how can I force itunes to use the firefox settings

    I fixed this issue (with help from tech support) and it involved several things.
    After adding a song to iTunes, right-click on the song in iTunes and select "Update iTunes Match."
    OR go to the iTunes menu-->Store-->Update iTunes Match.
    Maybe that's the reason, it just hadn't updated to the cloud.
    OR maybe it's not a high-enough bitrate file.   This happens to me because most of my tunes are home-recorded.
    Sometimes converting to .mp3 or Create AAC version might work. (You do this with a right-click in iTunes, and then you will want to remove the original file from iTunes.)
    There is an iTunes Preferences setting, under General Preferences called Import Settings.  Try setting it to AAC Encoder and iTunes Plus.   That (I think) causes imports to be slightly better quality.
    Good luck!  The tech support person at Apple is requesting that a knowlege-base article be written about this.

  • ActiveX UAC and Proxy Settings via GPO

    Hi there,
    Wondering if anyone can help.
    I am experiencing the following issue when trying to load ActiveX control without UAC prompts for standard users.
    I have:
    Configured ActiveXInstaller Service and configured allowed sites and settings via GPO.
    Configured IE Security settings for the Trusted Zone to Allow ActiveX content to run via GPO.
    Configured IE to use per user proxy settings via GPO.
    Allowed the domain in our proxy and bypassed authentication for that domain.
    Everything seems to be in place but I receive a UAC prompt for the Internet Explorer Add-on Installer UNLESS I either turn off the IE proxy  settings or add the domain to the IE proxy exclusions list.
    Unfortunately neither of these are options in our environment..
    Anything I've missed?
    Thanks!

    Hi,
    Before going further, what's the operating systems you are using? How did you configure
    approved Installation Sites for ActiveX Controls and Active X installation policy for sites in Trusted zones settings?
    Regarding how to configure these two settings, we can refer to the following article for double check.
    Administering the ActiveX Installer Service in Windows 7
    http://technet.microsoft.com/en-us/library/dd631688(v=ws.10).aspx
    Besides, we can also run command gpresult/h gpreport.html with admin privileges to collect group policy result report to check if the policy settings are applied correctly.
    Best regards,
    Frank Shen

  • IPad and proxy settings for more than AppStore and Safari?

    Why am I having problems w/ most apps and the proxy settings?  My corp. network requires proxy settings to get to the internet and only the AppStore and Safari (and a few specifically designed apps) will use the proxy settings.  All other apps simply do not work.
    Is this an Apple problem?  Why was this not addressed by Apple?

    NestOfRobins wrote:
    That sounds like a "cop-out" to me.  Do individual applications on desktop machines have to be "proxy aware"?
    Yes, they have. Not only on iPad, but every internet application, on Mac or on PC or on *nix, have to be coded internally to use proxies. Some are, and are also smart enough to check for any proxy info on network options of your system, some other will have the proxy info to be given in internal application setup, and some other, simply does not know what proxies are.
    NestOfRobins wrote:
    How can Apple expect to compete in the Enterprise space with this glaring hole in their operating system?  Why can't there be a setting, e.g., "all internet traffic to use proxy server".?
    That is a SOCK, and is another different stuff. There is no hole in the O.S., it is the app you want to use, because that app wants connect the internet by herself, without using your proxy.
    Best advice is, you ask that app's developer, to add in future releases, proxy connectivity or (best) to check if network requires a proxy and act accordingly without bother the user on the issue
    Anyway, I'd like answer also your other questions:
    NestOfRobins wrote:
    Why am I having problems w/ most apps and the proxy settings?
    You have problems because that apps don't think about the proxy setting you have in your network configuration (app poorly coded), or they require direct internet access in their specs (app aware of proxy, and do not want use it), access that you don't have because of proxy. Not your fault. Nor Apple's
    NestOfRobins wrote:
    this an Apple problem?  Why was this not addressed by Apple?
    Not an Apple problem, so there is nothing to address.

  • JRE and Proxy Settings

    Hello,
    I've created a proxy.pac that's been deployed to our ouposts. It works fine except for one web application which is using java.
    Now, I figured out that it's because I have to not only change the proxy-settings for IE and Firefox, but also for Java. Point is, it's user-based. So every user has to make these changes to make them become active.
    My question is: Is there a way (probably by manipulating the net.properties) to make this change systemwide and not only limited to a single user?

    The application is a browser based application. It's partially HTML/XML (right frame with content) and partially Javabased (left frame with navigation tree).
    Now when I change the browsers' settings to use a pac-file as a proxy configuration file, the HTML/XML-based part is using the proxy setting that is set in the browsers' properties and connects by using the proxy. But the Java-side of the application seems to ignore these settings and tries to get a direct connection to the application. This ends in two different sessions where you have to login again in order to see the navigation-tree displayed. Since these two sessions are different from each other, they won't work together.
    After correcting the proxy settings for the java runtime engine to also work with the configurationfile it works just fine.
    As I said, we already found a solution for the problem itself. All we need to have now is a way to make the proxy-settings for java systemwide for we don't want to correct these settings for each and every user.

  • Nokia Suite and proxy settings

    Hi,
    the suite has a big bug. Instead of using any Windows network connection, it defines its own proxy settings which is obviously nonsense. I entered the correct proxy credentials, it still fails to connect to the internet. If it would rely on Windows' own mechanisms, it could like just any other program.
    Conclusion: Nokia suite is unusable in a business environemt.
    Olaf

    In my campus where i live our network needs a proxy so the 1st problem was to download Nokia Suite. even i was not able to download it from its official site. Kindly look into this.
    Now when i got it and installed i cannot find a button of settings as it is in rest of the s/w's. there is a button called Tools but its value is 0. Due to this iam not able to log into my account and furture proceed.
    I have attached a screen shot of PC Suite window showing View, Sync and Tools buttons have a value 0.
    Kindly look into this matter.
    Attachments:
    nokia.JPG ‏33 KB

  • Shockwave player and proxy settings

    Hi,
    all clients our company must use a web-proxy to connect with the internet.
    If anyone want to watch a stream with rtmp://....swf , nothing happens.
    RTMP should work with port 1935 and fallback to 443, 80.
    Problem: shockwave ignores the proxy settings from browser and Device. He tries to connect
    directly without proxy, whitch is not working of course..
    Are there any options to configure the proxy settings for Shockwave or is this a bug?
    Thanks for any help!

    I think you're looking for a Flash Player forum

  • 9ias and Proxy Settings for Client(Urgent !!! )

    Dear All,
    I am facing a very strange problem.
    Our application is running on Oracle 9ias installed on Windows2000.
    When I access this from a WindowsXP M/C with browser(IE 6.0) privacy settings as medium(which is by default medium)and without IP address of 9ias m/c.(Which is infact not required),I do not get the menu of my application generated.
    I some how did some hit and trial and now when I put
    the IP in proxy settings of my client Browser, I am able to get the menus.
    Can anyone give some hint or somebody has faced the
    problem like this.
    Thanks in advance.
    Regards
    Dushyant

    NestOfRobins wrote:
    That sounds like a "cop-out" to me.  Do individual applications on desktop machines have to be "proxy aware"?
    Yes, they have. Not only on iPad, but every internet application, on Mac or on PC or on *nix, have to be coded internally to use proxies. Some are, and are also smart enough to check for any proxy info on network options of your system, some other will have the proxy info to be given in internal application setup, and some other, simply does not know what proxies are.
    NestOfRobins wrote:
    How can Apple expect to compete in the Enterprise space with this glaring hole in their operating system?  Why can't there be a setting, e.g., "all internet traffic to use proxy server".?
    That is a SOCK, and is another different stuff. There is no hole in the O.S., it is the app you want to use, because that app wants connect the internet by herself, without using your proxy.
    Best advice is, you ask that app's developer, to add in future releases, proxy connectivity or (best) to check if network requires a proxy and act accordingly without bother the user on the issue
    Anyway, I'd like answer also your other questions:
    NestOfRobins wrote:
    Why am I having problems w/ most apps and the proxy settings?
    You have problems because that apps don't think about the proxy setting you have in your network configuration (app poorly coded), or they require direct internet access in their specs (app aware of proxy, and do not want use it), access that you don't have because of proxy. Not your fault. Nor Apple's
    NestOfRobins wrote:
    this an Apple problem?  Why was this not addressed by Apple?
    Not an Apple problem, so there is nothing to address.

  • ADR and Proxy Settings on SUP

    As i known,the sup sync with windows update to update its update catalog only,there is an option on the SUP confuse me "Use a proxy server when downloading content by using automatic deployment rules".
    When ADR is running under background,the update contents approved by ADR actually are downloaded by site server but not the sup.
    How will this option work?
    In my case,I have the SUP out of the site server,and when I select this option,what will happen when adr is running?

    ADR will download the Update content through the Proxy server you define.
    http://technet.microsoft.com/en-us/library/gg712312.aspx
    Juke Chou
    TechNet Community Support

  • How to cross Firewall and Proxy Settings

    Hi,
    Every one eagerly waiting for the Reply for the Firewall Problem. I wan't to get rid from this situation. Is there any way to get out from this problem?

    Hi mqh7,<o:p></o:p>
    As we know group policy has two main configurations, user and computer. Accordingly, the computer policy is
    applied to the computer despite of the logged user and the user configuration is applied to the user despite of the computer he is logged on. <o:p></o:p>
    And as Denis said, the loopback processing of Group Policy has two different modes, Replace and Merge. It is obvious that Replace mode replaces User Configuration with the one applied to the
    Computer, whereas Merge mode merges two User Configurations. For your information, please refer to the following article;<o:p></o:p>
    http://support.microsoft.com/kb/231287<o:p></o:p>
    Regards,<o:p></o:p>
    Lany Zhang<o:p></o:p>

  • WLAN Proxy Settings - Saving User Id and Password

    I've looked around on the net but have not been able to find a solution to this problem.
    Using an N8 (on Nokia Belle), the WLAN settings does not seem to provide any place to specify the username and password for a proxy based network (Note: this is not the pre-shared key for the WLAN, but the username and password asked by the proxy server). When the browser is used, it prompts for the username and password and then works. However other applications cannot connect to this network as they seemingly lack this feature and the phone does not make this globally available. Nokia Configuration Tool (NCT) 6.3 seems to allow placement of username and password values. When configuration is transferred back to phone, NCT shows successfully configured, but this does not seem to be the case when the settings are used by the phone. Does anyone have a solution for this?

    Step 1
    Goto Connectivity Menu
    Menu Button - Settings - Connectivity
    Step 2
    Add new Access Point (continue from above)
    Settings - Destinations
    Step 3
    Set the new Access Point
    1) Select Access Point to add new access point.
    2) Select Yes for "Automatically check ......"
    3) Select WLAN for wifi & choose your corporate Access Point
    4) Select Internet to assign it to Internet group.
    Step 4
    1) Go back to menu in Step 2
    2) Select Internet.
    3) Select the new Access Point that you've added in Step 3 & it will give the details of it.
    4) Select Options - Advanced Settings
    5) And you should see IPv4, IPv6 and Proxy settings menu
    If I have helped you, please hit the star at the bottom of my posts - it's appreciated!
    Don't forget if your problem is solved to press the "Accept as Solution" button.

  • Adobe flash player proxy settings?

    hi there,
    in addition to my other post regarding proxy solution for flash content...
    does Adobe flash player have setting to force to use proxy? or any network configuration?
    thanks in advance

    Here is an interesting discussion regarding Flash Player and proxy settings http://www.techsupportforum.com/alternative-computing/mozilla-firefox-browsers/397364-diff erent-proxy-settings-flash-player.html

  • [Solved]Gnome 3 global proxy settings not working

    Hi
    My laptop runs Arch and I use it at a hostel and University. Both have different proxy settings and I had configured it by using a script (if one can call it that) in {/etc/profile.d/} that exported the correct settings. I had to edit (comment/uncomment) my setting every time I mover my laptop.
    I need the setting globally for Chromium to pick it up. Chromium until recently had a problem when accessing the Gnome 3 network (proxy) settings. A new update seem to have fixed this but the problem of picking up the setting remains.
    I started up a terminal to see how that global proxy setting in Gnome 3 were shown and found that only the following were set
    https_proxy
    all_proxy
    ftp_proxy
    The main one that I need {http_proxy} was not set, even thought I defined it. I think this is an issue with Gnome 3 and was not sure where I should report it. Any solutions will be much appreciated.
    Last edited by jlight2011 (2012-10-24 11:46:46)

    I've had issues lately with Gnome 3 and proxy settings. For example, as of today (or sometime this weekend) Firefox is not obeying the system proxy settings (System Settings -> Network -> Proxy). Even better was that today I found that the system proxy settings had "magically" reset to proxy.company.com:8080 (or whatever their default setting is). If I manually set Firefox's proxy settings, it connects just fine. All terminal applications that I use only obey the http_proxy environment variable. Other programs, such as Evolution, seem to not obey the Gnome system proxy settings but only the ones set in GConf (not DConf) (which were also "magically" reset today).

  • How could I set the proxy settings for just some URLs and not for all?

    Hello,
    I am using HttpURLConnection to establish a HTTP connection . The connection pass through a proxy, and it requires security.
    I know that I can set the proxy settings in the system properties, and this works perfect.
    But I don't want to set the proxy settings in the system properties, because this proxy settings will be for ALL the URLs, and I just want for a few URLs.
    How could I set the proxy settings for just some URLs and not for all?
    Thanks

    java.net.URL.openConnection(java.net.Proxy proxy)
    @since 1.5

  • Proxy settings with HttpURLConnection

    My program starts 2 threads.
    Thread A sets 2 system properties - https.proxyHost, https.proxyPort and makes a https request (needs to go through proxy) to WebApp1 using HttpURLConnection.
    Thread B unsets those 2 system properties and makes a http request (doesn't need to use proxy) to WebApp2 using HttpURLConnection.
    I am correct in doing the above?
    I am getting the following exception occassionally.
    javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:739)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
    at com.certegy.monitor.core.Connection.sendTransaction(Connection.java:255)
    at com.certegy.monitor.posipgw.POSIPGWMonitor.sendRequest(POSIPGWMonitor.java:248)
    at com.certegy.monitor.posipgw.POSIPGWMonitor.run(POSIPGWMonitor.java:84)
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:321)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:720)
    Please help me.

    We have a proxy configuration that requieres the input of an user and a password. If we try to update the Creator, we get the error 'Unable to connect to the Update Center Server. Check proxy settings ...'.
    If I remember well, the first time I tried the update feature, I think I got a pop up window to input the user and the password for the proxy. But now I get always the error message. If we shut down the proxy it works fine.
    Today I tried the 'GoogleSearch' demo application and the same problen occures.
    Thanks for information
    Guenther

Maybe you are looking for