×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    https Connection problem

    Hi,

    I have created one sample https midlet app which connects to my local Apache server and fetches one text file.

    My local Apache server is configured as SSL server. I have created a certificate using openSSL and configured my Apache server. Same certificate I have imported on sun sdk also. But I am getting following error while connecting to my server using https request("https://192.168.101.45:443/https.txt").

    java.io.IOException: getNextMsg refill failed
    at com.sun.midp.ssl.Handshake.getNextMsg(+37)
    at com.sun.midp.ssl.Handshake.rcvSrvrHello(+5)
    at com.sun.midp.ssl.Handshake.doHandShake(+29)
    at com.sun.midp.ssl.SSLStreamConnection.<init>(+173)
    at com.sun.midp.ssl.SSLStreamConnection.<init>(+12)
    at com.sun.midp.io.j2me.https.Protocol.connect(Protocol.java:323)
    at com.sun.midp.io.j2me.http.Protocol.streamConnect(Protocol.java:1657)
    at com.sun.midp.io.j2me.http.Protocol.startRequest(Protocol.java:1638)
    at com.sun.midp.io.j2me.http.Protocol.sendRequest(Protocol.java:1565)
    at com.sun.midp.io.j2me.http.Protocol.sendRequest(Protocol.java:1521)
    at com.sun.midp.io.j2me.http.Protocol.openInputStream(Protocol.java:486)
    at HttpsTest.readContents(+197)
    at HttpsTest.run(HttpsTest.java:161)

    HTTP request to same server is working fine.

    can anyone tell me what could be the problem?

    Thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: https Connection problem

    You shouldn't need to specify port 443... it should default correctly to that when you specify HTTPS.

    I'm not familiar with configuring Apache... make sure you have SSL2 enabled (not just TLS/SSL3).

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Thanks Graham for ur quick reply.

    I have also tried with just "https://192.168.101.45/https.txt". but its still the same.

    And yes my server is configure properly as i am able to connect to server from my desktop browser.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: https Connection problem

    Do you get a response code?

    Quote Originally Posted by girdhar View Post
    And yes my server is configure properly as i am able to connect to server from my desktop browser.
    Your browser will work if you only have TSL/SSL3 enabled. Do you have SSL2 enabled?

    Graham.

  5. #5
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    HI Graham,

    Yes I have SSL2 enabled on my server.

    When i am trying to connect to server, not getting any responce code.

    I have following lines of code. It just stuck at bold lines given below for some time and then throws IOExceptin mentioned above in first post.

    System.out.println("Before opening https connection " );
    httpsCon = (HttpsConnection)Connector.open(httpsURL);
    httpsCon.setRequestMethod(HttpsConnection.GET);


    respCode = httpsCon.getResponseCode();
    System.out.println("respCode : " + respCode);

    Is there any thing that I may be missing?

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Quote Originally Posted by girdhar View Post
    my server is configure properly as i am able to connect to server from my desktop browser.
    In your certificate on your server, what is your ‘Common Name’ (CN)?
    1. 192.168.101.45
    2. localhost
    3. something else
    Last edited by traud; 2009-06-17 at 15:28.

  7. #7
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Hi Traud,

    The common name in certificate on server is 192.168.101.45.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Have you tried a Series 40 emulators? Some contain a complete internet browser where you can add your certificate authority and check your webpage as that browsers gives verbose warnings. Those could help before you go down into MIDP land as that browser has to be happy, first.

  9. #9
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Hi Traud,

    I have installed S40 emulator but dont know how to add certificate on that. There is no option avilable on simulator to add the certificate.

    can u tell me any work around to this?

  10. #10
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Does this help (especially that)?
    Last edited by traud; 2009-06-25 at 19:09.

  11. #11
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Hi Traud,

    Thanks for the reply. The link what u have mentioned is talking abt having certificate on S40 devices. I am trying to get it work on S40 emulator first. Is there any way that I can install certificate in any emulator(not limited to S40) and get my MIDlet tested?

    I just want to show a demo to my manager on emulator saying in this way our MIDlet can connect to server using https request. :-)

  12. #12
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: https Connection problem

    Quote Originally Posted by girdhar View Post
    Hi Traud,

    Thanks for the reply. The link what u have mentioned is talking abt having certificate on S40 devices. I am trying to get it work on S40 emulator first. Is there any way that I can install certificate in any emulator(not limited to S40) and get my MIDlet tested?

    I just want to show a demo to my manager on emulator saying in this way our MIDlet can connect to server using https request. :-)
    Hi,
    I wonder if that can be done,certificates are for the device only.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  13. #13
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Hi Raj,

    You mean to say, we can't test https related stuff on emulator? Because as i know, to test https related stuff, client(i.e. emulator in my case) and server should have one common certificate. isn't it?

  14. #14
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Quote Originally Posted by girdhar View Post
    The link what u have mentioned is talking abt having certificate on S40 devices. I am trying to get it work on S40 emulator first.
    Sorry, I do not know how to answer more politly, please do not get it wrong: What is the difference? Have you ever started one of the Series 40 emulators? Which one? Does it have a complete menu including a browser?

  15. #15
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Bangalore, India
    Posts
    81

    Re: https Connection problem

    Hi Traud,

    First of all, don't be sorry. You have not said anything wrong.

    Yes, I have tried on Nokia_S40_DP20_SDK_6230i_1_0 emulator and it has complete menu including a browser. When I had typed my server url in browser and tried to go to that page, I am able to open my server page using HTTP request but not using HTTPS. As soon as I type any HTTPS url, its says Secure Connection not allowed.

Similar Threads

  1. E65 SIP connection problem
    By Razzle in forum VoIP
    Replies: 20
    Last Post: 2010-04-05, 13:10
  2. Urgent :problem while running HTTPS in J2me for Nokia 3250
    By ratan_java_me in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-05-02, 17:45
  3. Bluetooth direct connection problem
    By mrautane in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-02-14, 06:33
  4. Problem with connection timeout
    By maniac_2k in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2006-09-21, 20:12
  5. HTTPS connection problem.
    By shiben in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-09-21, 06:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×