Problems using https protocol to connect to open a web site

Hi,
I am trying to connect to a web site from my java programme. When I try connecting using htpp protocol, I am able to open the web page then I am giving the username,password to login into that web site..its working fine.
But, When I try connecting using https protocol connection, I am not getting the page opened and after some time I am getting below error
Exception in thread "main" org.apache.xmlrpc.XmlRpcException: I/O error while communicating with HTTP server: Connection timed out: connect
     at org.apache.xmlrpc.client.XmlRpcCommonsTransport.writeRequest(XmlRpcCommonsTransport.java:244)
     at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:151)
     at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
     at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
     at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
     at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
     at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
     at com.wipro.bugc.Test1.call(Test1.java:94)
     at com.wipro.bugc.Test1.main(Test1.java:124)
Caused by: java.net.ConnectException: Connection timed out: connect
Can anyone please suggest or give sample code to work with https web sites in java.
I will have to use only https protocol to open any browser as my server only opens the web pages using https protocol
Thanks in advance

Hi,
Thank you for your immediate reply. Please find the below code for your infomationa and please let me know where I am wrong..
Below is the example we used to connect to "rojects.maemo.org" site and end up with the error I mentioned in the previous topic.
package com.wipro.bugc;
import java.net.Authenticator;
import java.net.URL;
import java.security.cert.X509Certificate;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
public class Test1 {
    private static void install() throws Exception {
        // Create a trust manager that does not validate certificate chains
        TrustManager[] trustAllCerts = new TrustManager[] {
            new X509TrustManager() {
                public X509Certificate[] getAcceptedIssuers() {
                    return null;
                public void checkClientTrusted(X509Certificate[] certs, String authType) {
                    // Trust always
                public void checkServerTrusted(X509Certificate[] certs, String authType) {
                    // Trust always
        // Install the all-trusting trust manager
        SSLContext sc = SSLContext.getInstance("SSL");
        // Create empty HostnameVerifier
        HostnameVerifier hv = new HostnameVerifier() {
            public boolean verify(String arg0, SSLSession arg1) {
                    return true;
        sc.init(null, trustAllCerts, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier(hv);
    public static void call(String url) throws Exception {
         HttpClient httpClient = new HttpClient();
         httpClient.setHttpConnectionFactoryTimeout(600000000);
        httpClient.getParams().setAuthenticationPreemptive(false);
       Credentials defaultcreds = new UsernamePasswordCredentials("username", "password");
       httpClient.getState().setCredentials(new AuthScope("projects.maemo.org", 443, AuthScope.ANY_REALM), defaultcreds);     
          HttpHost targetHost = new HttpHost("projects.maemo.org", -1, "https");
          System.setProperty("proxySet", "true");
          System.setProperty("http.proxyHost", "xxxx.com");
          System.setProperty("http.proxyPort", "xxxx");
          Authenticator proxyAuthenticator = new HttpAuthenticateProxy(
                    "username", "password");
          Authenticator.setDefault(proxyAuthenticator);
          XmlRpcClient rpcClient = new XmlRpcClient();
          XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory(
                    rpcClient);
          factory.setHttpClient(httpClient);
          rpcClient.setTransportFactory(factory);
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setServerURL(new URL(url));
        config.setEnabledForExtensions(true);
          config.setEnabledForExceptions(true);           
          config.setBasicUserName("username");
          config.setBasicPassword("password");
          rpcClient.setConfig(config);      
          Map<String, String> loginMap = new HashMap<String, String>();
          String bugzillaUserName = "username";
          String bugzillaPassword = "password";
          loginMap.put("login", bugzillaUserName);
          loginMap.put("password", bugzillaPassword);
          Object loginResult = rpcClient.execute("User.login",new Object[] { loginMap });
          System.out.println("loginResult.toString() "
                    + loginResult.toString());
    public static void main(String[] args) throws Exception {
        String url = "https://projects.maemo.org/bugzilla_sandbox/xmlrpc.cgi";
        Test1.install();
        Test1.call(url);
        System.out.println("Finished.");
}

Similar Messages

  • Problems using ODBC Driver. Connection never opens.

    Hi,
    I have a problem with the ODBC driver for oracle.
    This is the behaviour: the first attemp of connection doesn't work, the connection never opens. the second attempt is almost instantaneous but 10 minutes later the connection fails again. It is neccesary to close and open the app using the odbc driver again.
    I've tried everything.
    Thanks in advance,Regards.

    Hi,
    Quote: "ERROR [IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified".
    This error is typically thrown because the code is specifying a DSN that does not exist. So, please make sure you are referencing a DSN that has been created.
    You can refer to this article below:
    https://community.microfocus.com/borland/test/silk_test/w/knowledge_base/10737.how-do-i-resolve-error-im002-microsoft-odbc-driver-manager-data-source-name-not-found-and-no-default-driver-specified.aspx
    Or please add the right conenction string. You can look at following website:
    http://www.connectionstrings.com/
    Note This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and
    has not tested any software or information found on these sites.
    Andy Altmann
    TechNet Community Support

  • Upload using HTTP protocol

    my requirement is to upload/tranfer a file to remote server(LAN/WAN) using http protocol.
    my application is not a web based application.
    if anybody knows how to do it, pls. let me know.
    thanks and regards
    Savitha

    You can use an URLConnection, but you need to cast it the HttpURLConnection in order to set the "method". The "official" method which ought to work for uploads is the "PUT" method, but it's not often used and, as a result, not all web proxies handle it. You may find POST is safer, even if your data isn't formatted as POST expects.
    It goes something like (from memory)
    URL url = new URL( ..... );
    HttpURLConnection con = (HttpURLConection)url.openConnection();
    con.setMethod("PUT");
    con.addHeader("Content-length", fileLength);
    con.addHeader("Content-type", mimeType);
    con.setDoOutput(true);
    OutputStream out = con.getOutputStream();
    ...Be warned though: Web systems do not expect very large uploads. Web proxies, in particular, can often cause a lot of grief if you are trying to upload anything about a megabyte or two in one message.
    It's important to set the Content-Length correctly to the size of the body data, since otherwise the system doesn't know when you've finished sending.

  • Signed Applet not loading on Mac OS X if using HTTPS protocol

    Hi All,
    I need to open a trusted applet on Mac OS 10.2. The applet works fine if using HTTP protocol. But if the protocol used is HTTPS the the applet does not loads and "javax.net.ssl.SSLException - untrusted server cert chain" exception comes on the console.
    The error comes for both - Verisign and javakey - signed applet.
    On seaching for possible solution on the net, i came across following link: http://www.macosxhints.com/article.php?story=20020525101202503&query=Workaround+for+secure+Java+applet+problems
    It says that this is Mac's known bug and gives the workaround as:
    1. Access the problematic site with Internet Explorer on Windows. Click on the padlock item and export the certificate to a file.
    2. Copy the certificate to your Mac.
    3. Use the command
    sudo keytool -import -trustcacerts -keystore /Library/Java/Home/lib/security/cacerts -file mycert.cer
    to import the certificate file to your keystore (substitute mycert.cer with the name of the file containing the certificate). The keystore is password protected - the default password is "changeit".
    4. Restart your browser
    But the client cannot be asked to do all this to run the applet.
    Is this problem being solved by Mac in their java implementation or is there any other possible solution?
    Thanx in advance.
    Regards,
    Charu

    I am experiencing the same problem - I notice it does not happen on OS9.2 using IE but appears a problem on all browsers on OSX
    Apple gave me the following reply.....
    Re: Bug ID# 3268633: cannot load applet class under https connection
    Hello Andrew,
    Thank you for bringing this problem to our attention. We have received feedback
    from engineering on your
    reported issue.
    Please know that to get Java to recognize the certificate you will need to do
    one of two things, depending
    on which VM you are using. Since you want it to work with Internet Explorer, we
    will assume Java 1.3.1.
    In Java 1.3.1 you'll need to add the certificate to
    /Library/Java/Home/lib/security/cacerts using
    /usr/bin/keytool to import the certificate into the certificate database.
    In Java 1.4.1 you should be able to just add the certificate to the keychain
    using certtool. For more
    details on how to do this, please refer to the information found at
    <http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/keytool.html>. After
    doing so, if you should require
    further help from Apple in resolving this issue, we recommend that you request
    assistance from Developer
    Technical Support. This must be done by filing a Technical Support Incident.
    So I am supposed to tell every Mac user to do the above am I?!!!

  • Using https protocol thru Oracle Developer 6.0

    Hi ,
    I would like to know if it is possible to use https protocol from Oracle Developer 6.0.
    we have used http protocol when using
    Show_Document() and it works fine. But when we try to use https (which our application requires - secure mode)then we get the following error:
    FRM-99999 Invalid URL sent to browser with target_BLANK.
    Full Details: unknown protocol:https
    We would appreciate any help on this problem.
    Are there any patches which would enable the use of this protocol??
    Thanks,
    Sanjay Sinha
    email:[email protected]
    null

    There are other services that may cause you trouble.
    I have had to turn off SMTP and DHCP services in the past.

  • ITSMobile using HTTPS protocol

    Hello,
    I am new on ITSMobile and I am having issue connecting using https protocol.  I keep getting a message on my device MC70 "The Web site you want to view request identification.  Select the certificate to use when connecting".  Unfortunately I only got a blank box and nothing to choose.  When I click OK I only get the previous site I been to and will not get the login screen that I need.
    I am using a Symbol MC70 with windows mobile 5.0.  All the settings in SICF are okay so with the ports.  I appreciate whoever can give help on my issue.

    We are having the same issue.
    Does anybody have any suggestions?  We are using a self-signed certificate.

  • I am using Ipad 2, Wi-Fi is connected but cant open any web-site " error : Safari cannot open the page because it is not connected to the internet "

    I am using ipad 2, Wi-Fi is connected but cant open any web-site " error : safari cannot open the page becasue it is not connected to the internet "
    need support please

    You haven't provided much information, such as what type of router you have?  If you entered the encryption key as the password as opposed to the router name you have selected?  If you have WEP or WPA?  What you've tried that didn't work, other than saying it doesn't work?  So, below is a link to some assistance.  Follow this and see if it helps you.........
    http://www.apple.com/support/ipad/assistant/wifi/

  • "Set Web Site Rule" window is annoying. how do i shut off this function it poped up more than a dozen times to connect to even this web site? then i had to click it another dozen plus times to get this site open !!!! ???

    when ever i put in an address or click on a site a "Set Web Site Rule" window pops up asking if i want Firefox exe to allow some function to occur. it does not seem to be security related but rather simple functions. Step 1, step 2 , blah blah . "Set Web Site Rule" window is annoying. how do i shut off this function it popped up more than a dozen times to connect to even this web site? then i had to click it another dozen plus times to get the next mozilla site open !!!! ??? if firefox does not know what it is doing how can i??????
    == This happened ==
    Every time Firefox opened
    == i am just setting up this pc how ever i down loaded the most recent version 3.6.3

    by submiter - self solved: (thanks for the psychic help)
    seems the problem was not with Firefox itself. Rather it seemed to have been an ad-blocker program called "WebMonitor" . i began by deleting Firefox and then opened Explorer (which i seldom do) and the same thing began to happen with MSN. So i
    began deleting anti-virus programs till i came to the above mentioned freeware ad blocker "WebMonitor". it is a shame because i uised to have a program that blocked all ads on a web site which was such a relief to me.

  • Safari will not open certain web sites with https or http

    safari will not open certain web sites with https or http,any help will be welcome,it must be a security setting,but i have not changed any settings.

    From your Safari menu bar click Safari > Preferences then select the Exensions tab.
    If there are any installed, switch the button to off, quit and relaunch Safari to test.
    If there is more than one extension insalled, uninstall one a time, quit and relaunch Safari and test.

  • Why is my firefox not opening specific web sites like youtube, facebook and hotmail? Please help me or ill will have to start using another browser....

    I can not open specific web sites like youtube, facebook and hotmail in my firefox! This time is youtube, last time was hotmail and now also facebook...

    Do a malware check with some malware scanning programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    * "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    More:
    * http://kb.mozillazine.org/Error_loading_websites

  • Safari can't open specifics web sites

    i'm having troubles to re-open some web sites visited earlier.
    I'm on a macbook pro with leopard and safari 5.0.1, all updates installed
    Example: www.tgcom.it
    The first time opened without any problem, the second time can't open again.
    after typing the address and hit the return key, safari display immediately (without even trying to load the page) the white page with the alert:
    Safari can't connect to the server.
    Safari can't open the page “http://www.tgcom.it/” because safari can't connect to the server “www.tgcom.it”.
    I've try already to reset Safari and clean the cache. No changes.
    On the same network I have an iMac, which is loading this page anytime without any problem.
    As well a windows PC is on the same home network, the page can be loaded too.
    Only on this macbook pro i'm experiencing this issue.
    I don't know what to think more..... the problem can't be the web-site (it works with other machines)
    Other web sites on the macbook are working properly, only three address seams to be blocked from this machine only....
    any suggestions???? thanks
    Marco

    I suspect it has something to do with your ISP.
    Adding Open DNS codes to your Network Preferences, should give good results:
    If you are using a single computer: Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu, and in the box marked 'DNS Servers' add the following two numbers:
    208.67.222.222
    208.67.220.220
    (You can also enter them if you click on Advanced and then DNS)
    Sometimes reversing the order of the DNS numbers can be beneficial in cases where there is a long delay before web pages start to load, and then suddenly load at normal speed:
    http://support.apple.com/kb/TS2296
    If your computer is part of a network: please refer to this page: http://www.opendns.com/start/bestpractices/#yournetwork and follow the advice given.

  • Safari doesn't open certain web sites

    Hi there,
    I'm a web designer working on a new site. My clients say that their Mac which is running Safari 5.1.5 won't open their web site which is: http://www.adventuress.us
    I've asked about 5 other people to see if they could open it up on a mac using Safari.  So far, everyone can open it except for my client.
    Can you help me troubleshoot this?  The site is created with wordpress.  It's not redirecting.
    I'm really not sure which Mac they have or their operating system.  I just chose two so that I could submit this ticket.
    What in the world would stop them from being able to see the site? They can go to other sites.
    Thanks.

    Hi...
    What in the world would stop them from being able to see the site?
    Ask if they have anti virus software installed ..
    It would help to know for sure which Mac OS X they have installed. Click the Apple menu icon top left corner of the screen. From the drop down menu click: About This Mac.
    I'm running Lion v10.7.3 with Safari 5.1.5 on one Mac without any problems loading that site. Same with another Mac running Snow Leopard v10.6.8.
    I am using OpenDNS which may help your client and is suggested by Apple > Safari 5.0.1 or later: Slow or partial webpage loading, or webpage cannot be found
    Use OpenDNS for better speed, more security, includes anti phishing filters, prevents browser redirects, blocks the flashback trojan, and it's free.
    Open System Preferences / Preferences then select the Network tab. Click the Advanced tab then click the DNS tab.
    Click +
    Enter these addresses exactly as you see them here.
    208.67.222.222
    Click +
    208.67.220.220
    Then click OK.
    Quit then relaunch Safari. Try that site.
    edited by:  cs

  • My safari can't open no web sites at all

    I have actualised the safari to 5.0.5 (for Leopard) and still cant open any web site.
    I use leopard Mac OS X 10.5.8
    Without opening safari my xmarks for safari ask to download an actualisation but it cant go to the web page.
    With Firefox or Chrome I dont have any trouble.
    Any help?
    Thanks

    I suspect it has something to do with your ISP.
    Adding Open DNS codes to your Network Preferences, should give good results:
    If you are using a single computer: Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu, and in the box marked 'DNS Servers' add the following two numbers:
    208.67.222.222
    208.67.220.220
    (You can also enter them if you click on Advanced and then DNS)
    Sometimes reversing the order of the DNS numbers can be beneficial in cases where there is a long delay before web pages start to load, and then suddenly load at normal speed:
    http://support.apple.com/kb/TS2296
    If your computer is part of a network: please refer to this page: http://www.opendns.com/start/bestpractices/#yournetwork and follow the advice given.

  • Can't open bank web site

    I tried to open bank web site but it gave me this massage
    ''Safari can’t open the page “http://www.sabb.com/” because the server where this page is located isn’t responding'' .
    I was able to open this site before, I can't remember what I have change.
    I change Safari Security to accept cookies always and firewall to allow all incoming connection but no use........ Any suggestion????

    Some banks are notoriously uncaring and lazy about what systems and browsers they support.
    Try reading these threads:
    http://discussions.apple.com/thread.jspa?threadID=1893522&tstart=0
    http://discussions.apple.com/thread.jspa?threadID=1831414&tstart=175
    http://discussions.apple.com/thread.jspa?threadID=1828195&tstart=200
    As it says in this document:
    http://developer.apple.com/internet/safari/
    "Safari complies with standards, but not all browsers do. This article explains how to design, modify and validate your website so that it can be rendered and read properly by all major browsers."
    The bank/s need to read this:
    "Safari is one of the most standards-compliant browsers ever built. Thus, your best bet for ensuring your pages render properly in Safari — today’s version and beyond — is to follow web standards. For a great overview of web standards, check out Mozilla.org’s article Using Web Standards in Your Web Pages."

  • I cannot open my web site

    I get the following message when I try to open my web site which is cherrycreekwoodcrafts.com
    "An error occurred while processing your request.
    Reference #97.1625eb3f.1348245432.690562e"
    I'm using a MacBookPro, all software in current except iWeb.  When I try to update iWeb from 1.1.2 to 2.0.3 I get the following "An eligible iWeb application was not found in the location /Applications."  iWeb is, infact, in my Applications folder.  Are there two applications folders?  Am I looking at the wrong one?  FWIW, I updated to 1.1.2 just this from 1.1.1 morning with no problems.
    Any ideas or suggestions would be appreciated.
    Thanks in advance

    What website file are you trying to open when you open your site?
    You need to open your domain.sites file located under User/Library/Application Support/iWeb/domain.sites.
    Sounds like you are trying to open a published site and iWeb can't do that as it has no import facility - one way process.
    Also, if you hve iWeb version 1.1.2, this is iWeb 06 contained in iLife 06 and version 2 is iWeb 08 and you cannot just update like that from iWeb 06 to iWeb 08.  If you want to update your iWeb from iWeb 06 to iWeb 08, then you need to purchase the boxed set of iLife 08.  Better still, upgrade and purchase the iLife 09 or iLife 11 boxed set which contains the latest and last version of iWeb which is iWeb 09.
    You'll have to purchase this from Amazon though, as Apple no longer sells or supports iWeb since MobileMe ceased to exist at the end of June this year.

Maybe you are looking for

  • Low batterie warning

    HI My mac does not alert me when is running out of power and just switch off. is that normal? what can i do thanks

  • Load Balancing multiple web servers

    Hi All: I need to load balance 2 different web servers using sticky connections on a LocalDirector 416. I need to use cookie-passive mode, which of course relies on a cookie set by the web server. Problem: The name of the session cookie is different

  • Creation of production client copy

    Hai, What are the prerequisites for creation of client copy for production? This is in regard to eleminate the default company codes existing in 000 client. In case if we opt for sap_cust the entire company code is copied. Thanks Hari Mohan

  • Airport utility "not supported on this architecture"

    i have the original airport express, using macbook pro with 10.5.4. i've used the ax to extend the range of my current network, stream music, and share a printer. i moved and need to use airport utility to set up the network but it won't launch sayin

  • MS Project 2010 No Longer Respecting Links (i.e. ignoring predecessors)

    I'm using Project 2010 and everything was working fine until all of the sudden Project stopped respecting links between my tasks.  In other words it is no longer considering predecessors when scheduling subsequent tasks.  This is true across all my p