How to use SSLSocket on midlet ???

I am writting a midlet that need a SSLSocket to connect to a server. I am looking for a method or a framework that provide the SSLSocket connection in J2me. Anyone can help me, please.
Thank you in advance.

I am writting a midlet that need a SSLSocket to connect to a server. I am looking for a method or a framework that provide the SSLSocket connection in J2me. Anyone can help me, please.
Thank you in advance.

Similar Messages

  • How to use SSLSocket on a signed jar applet?

    Hello:
    OK, I finally could make work my client-server project, not the way I 'd like, but it works.
    Now the problem is this:
    Currently I have my applet in a jar file; saiCte.jar, which is signed in this way:
    keytool -genkey -keystore TECSSDStore.keystore -alias Key1 -keyalg RSA -storepass tttttt -keypass tttttt
    jarsigner  -keystore TECSSDStore.keystore -signedjar  saiCte.jar  temp.jar  Key1  -storepass tttttt -keypass tttttt
    But signature is not useful for appletviewer, in my browser, I supposed that a signed applet would work, but it doesn't. There is a handshake problem. In the server it is:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    I have to run the applet this way:
    java -Djavax.net.ssl.trustStore=TECSSDStore.keystore -Djavax.net.ssl.keyStorePassword=tttttt -Djava.security.policy=SecPolicy sun.applet.Main Cte.html
    Cte.html is this:
    <applet    code = 'saiCte.class'  archive='saiCte.jar' width='750' height='480'>  </applet>So how could I make my signed jar work in the browser? I considered setting properties, but it worked, I would reveal my password. Currently the only way I know for distributing my applet is including the keystore and password, which is inadmissible, since I signed the jar (or why am I supposed to sign jars if anyway I have to send keystore and passwords?)
    Thanks!

    Questions:
    1. Are you using client authentication in this SSL setup?
    In the server I have this:
    Socket.setWantClientAuth(false);
    I guess if this option is false and the client chooses not to provide authentication information about itself, the negotiations will continue.
    I read in SSLSocket API docs for setUseClientMode that "Servers normally authenticate themselves, and clients are not required to do so. "
    2. What is in this keystore that you want to distribute?
    In my keystore there is only what can be produced with this:
    keytool -genkey -keystore TECSSDStore.keystore -alias Key1 -keyalg RSA -storepass tttttt -keypass tttttt
    Now, I would have to distribute it if I want to run the applet from appletviewer:
    java -Djavax.net.ssl.trustStore=TECSSDStore.keystore -Djavax.net.ssl.keyStorePassword=tttttt -Djava.security.policy=SecPolicy sun.applet.Main Cte.html
    Which is the key of my problem: I do have a certificate, so I should not need to send the keystore and I should be able to run the applet from the browser. Actually it does run, the problem is in the connection:
    In the client: (from firefox's Java console:)
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at java.io.DataInputStream.readInt(Unknown Source)
         at r.a(Unknown Source)
         at X.actionPerformed(Unknown Source)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
         at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
         at sun.security.validator.Validator.validate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         ... 23 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
         at java.security.cert.CertPathBuilder.build(Unknown Source)
         ... 29 more
    In the server:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at java.io.FilterInputStream.read(Unknown Source)
    at Tipos.TString.Read(TString.java:62)
    at saiSrv$ConsultaServidor.run(saiSrv.java:1045)
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.DataOutputStream.writeInt(Unknown Source)
    at saiSrv$ConsultaServidor.<init>(saiSrv.java:1030)
    at saiSrv.<init>(saiSrv.java:970)
    at saiSrv.main(saiSrv.java:993)
    OK, thanks for the help, it's midnight in America, (you are in australia aren't you) so I'm going to the bed, can we continue chatting tomorrow?

  • How to load image to midlet using SUN ONE Studio 4, ME?

    Hi, everyone:
    I'm trying to load an image to my midlet using Sun ONE Studio.
    Image image = null;
    try
    image = Image.createImage("/Duke.png");
    }catch (Exception ex) {}
    ImageItem item = new ImageItem(null,image,ImageItem.LAYOUT_CENTER,null);
    append(item);
    I copied Duke.png in the same directory with midlet class file. But I can't see the image. I can get correct result by using J2ME wireless toolkit.
    Anybody know how to use Sun ONE Studio to load image?
    Thank you in advance!

    Hi, everyone:
    I'm trying to load an image to my midlet using Sun ONE
    Studio.
    Image image = null;
    try
    image = Image.createImage("/Duke.png");
    }catch (Exception ex) {}
    ImageItem item = new
    m = new
    ImageItem(null,image,ImageItem.LAYOUT_CENTER,null);
    append(item);
    I copied Duke.png in the same directory with midlet
    class file. But I can't see the image. I can get
    correct result by using J2ME wireless toolkit.
    Anybody know how to use Sun ONE Studio to load image?
    Thank you in advance!
    Hi,
    I have the same problem that you had with the path to the .png file in
    sun one studio 4, ME.
    Have did you solve it?
    I have all my .java files and the .png file in the same dir. and
    the call for creating the Image look like this:
    logo = Image.createImage("/splash3.png");
    and it does not work.
    The .png file is in the jar content.
    Will be thankful for all help!

  • How to use URL class instead of Socket

    Hi all. I am developing a small inventory control system for a warehouse.
    I am suing a Java desktop application that connects to a servlet via Internet.
    I have been searching the net how to use JSSE for my application since i am new to secure sockets and JSSE.
    Since I havent implemented security In my current system yet, i am using URLConnection conn = url.openConnection(); to connect to a servlet.
    However, in a good tutorial that I found about JSSE, sockets are used directly for connection, insted of URLCOnnection. They use the code like this: SSLSocketFactory sf = sslContext.getSocketFactory();
    SSLSocket socket = (SSLSocket)sf.createSocket( host, port ); Since, using sockets is overly complex for me, I want to make use of the URLConnection class instead to keep it simple.
    Could anyone please tell me how to make use of the URLConnection class to establish secure http connection.
    by the way, the tutorial is here:
    http://www.panix.com/~mito/articles/articles/jsse/j-jsse-ltr.pdf
    thanks.

    Here you go. The following code snippet allows you post data to http URL. If you have to do the same to https URL , please let me know.
    OutputStream writeOut = null;
    HttpURLConnection appConnection = null;
    URL appUrlOpen = null;
    //data to be posted.
    String data = "This is the test message to post";
    byte[] bytesData = this.data.getBytes();
    appUrlOpen = new URL(""Your Servlet URL");
    appConnection = (HttpURLConnection) appUrlOpen.openConnection();
    appConnection.setDoOutput(true);
    appConnection.setDoInput(true);
    appConnection.setUseCaches(false);
    appConnection.setInstanceFollowRedirects(false);
    appConnection.setRequestMethod("post");
    appConnection.setRequestProperty("Content-Type","application/text");
    appConnection.setRequestProperty("Content-length", String.valueOf(bytesData.length));
    writeOut=appConnection.getOutputStream();
    writeOut.write(bytesData);
    writeOut.flush();
    writeOut.close();
    String inputLine;
    StringBuffer sb = new StringBuffer();
    reader = new BufferedReader(new InputStreamReader(appConnection.getInputStream()));
    char chars[] = new char[1024];
    int len = 0;
    //Write chunks of characters to the StringBuffer
    while ((len = reader.read(chars, 0, chars.length)) >= 0)
    sb.append(chars, 0, len);
    System.out.println("Response " + sb.toString());
    reader.close();
    sb=null;
    chars = null;
    responseBytes = null;
    ******************************************************************************************

  • Don't know how to use canvas

    Hello,
    I'm new to J2ME and I got lost with all the information about J2ME on the web.
    I need help in the following thing.
    I want to make a graphical main menu for my midlet, but I don't know how to use CANVAS.
    I'm sure that there is template that I can customize it without writing all the code from the begining, but I can't find it.
    I'll be very happy if somebody can send me a link that contains a sample or template for main menu using CANVAS.
    also, I'll be happy to get a web site that explains all the canvas subject step by step. with examples that I can run.

    Hello.
    In order to use the printer with your iOS devices, please make sure that the units are all connected to the same WI-Fi router.  Once this has been done you should be able to print.
    The initial Wi-Fi setup of the MG3222 would have to be done from a compatible Windows or Mac OSX computer.
    If additional assistance is needed, feel free to call us at 1-800-OKCANON.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How to use mobile phone buttons

    hello. you know how to use left right up down and fire buttons without using canvas ? I am using MIDlets and when I have lots of forms. When the user clicks next button, he should go to next page. When the user clicks previous button he should go to previous page and also fire button works? Is it possible using previous, next and fire buttons without using keypressed() ? de.enough.polish can be used to use next previous buttons ?

    In MIDP, it is simple to navigate between different screens (pages?) using Command objects. If needed, [click here to learn|http://developers.sun.com/mobility/midp/articles/ui/|MIDP GUI Programming] +"...description of the GUI classes included in the MIDP with examples of how to use them. This article concludes with guidelines to GUI programming for mobile information devices..."+
    BTW there's no API in MIDP to access buttons like fire from within forms, unless these contain CustomItem objects

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • Can't figure out how to use home sharing

    Since the latest couple iTunes updates, my family and I can not figure out how to use home sharing. Everyone in our household has their own iTunes, and for a long time we would just share our music through home sharing. But with the updates, so much has changed that we can no longer figure out how to use it.
    I have a lot of purchased albums on another laptop in the house, that im trying to move it all over to my own iTunes, and I have spent a long time searching the internet, and everything. And I just can't figure out how to do it. So.... how does it work now? I would really like to get these albums from my moms iTunes, onto mine. I would hate to have to buy them all over again.
    If anyone is able to help me out here, that would be great! Thanks!

    The problem im having is that after I am in another library through home sharing, I can't figure out how to select an album and import it to my library. They used to have it set up so that you just highlight all of the songs you want, and then all you had to do was click import. Now I don't even see an import button, or anything else like it. So im lost... I don't know if it's something im doing wrong, or if our home sharing system just isn't working properly.
    Thanks for the help.

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use airport time capsule with multiple computers?

    I'm sure there are some thread about this but i couldn't find it... so sorry for that but hear me out! =)
    I bought the AirPort Time Capsule to back up my MBP
    And so i did.
    then i thought "let give this one a fresh start" so i erased all of it with the disk utility and re-installed the MBP from the recovery disk.
    I dont want all of the stuff i backed up just a few files and some pictures so i brought that back.. so far so good.
    Now i want to do a new back up of my MBP so i open time machine settings, pick the drive on the time capsule and then "Choose" i wait for the beck up to begin, and then it fails.  It says (sorry for my bad english, im swedish haha) "the mount /Volume/Data-1/StiflersMBP.sparsebundle is already in use for back up.
    this is what i want:
    i want the "StiflersMBP.sparsebundle" to just be so i can get some stuf when i need them. it's never to be erased.
    i want to make a new back up of my MBP as if it's a second computer...
    so guys and girls, what is the easiest and best solution?
    Best regards!

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use a Table View in AppleScriptObjC

    How can I use a table view and add data to it? And how can I display a button cell and image cell in the table? Thanks.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,

    how to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,
    i want the output should be seprated by '|' delimited when i download the file.

    Hi,
    We will pass the seperator to the WRITE_FIELD_SEPARATOR parameter as
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = v_file
    write_field_separator = '|'
    TABLES
    data_tab = itab[] . "Our internal talbe filled with data
    Re: Why Function GUI_DOWNLOAD can create XML file but not a flat file?
    Award points if useful
    Thanks,
    Ravee...

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

  • Sender Mail Adapter - S/MIME - How to use it?

    Hi guys,
    I am trying to figure out how to use the S/MIME security parameter of the Sender Mail Adapter in PI 7.1.
    Could anyone point me to some useful documentation/examples/blogs ?
    Or perhaps explain what steps are involved when configuring this parameter?
    We are pulling emails from an Microsoft Exchange server.
    Many thanks,
    Aldo

    First of all one sender mail adapter has to be tight with a specific sender email address.
    The email has to be decrypted as whole, you cannot decrypt parts of it.
    Then you store certificates to secure store in J2EE server and point to it in send agreement, this should be equal to HTTPS setup
    Check security guide:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/f7/c2953fc405330ee10000000a114084/frameset.htm

Maybe you are looking for

  • Critical stock as positive qty in LL01

    Hi Experts, could any of You pls help me to identify a reason for critical stock? There is positive qty in my certain storage type shown in LL01, even though the mterial qty is handled with TR - TI - material staging process based on requisition, usi

  • New iPad is not working for iMessage and FaceTime ?? Help

    Just purchased the new iPad today it will not let me sign on to iMessage and FaceTime but I am connected on wifi .... Help.

  • How can I use my iMac (2011 - 27") to play my x-box ?

    I understand there are issues around the Thunderbolt port - is there any 3rd party adaptor available to allow 'video in' to the new iMac ?

  • Db Table for STATUS

    Hi, In IQ09 we will give Status Included and Status Excluded . In what table that status is storing ? that status belongs to serial number. Bye, Satya.

  • Exit the loop of screen in Module pool

    Hi, My requirement is : in my screen i have Table control. When i select any line (the value of select coloum will be 'X' ) and click on one button (Detail is button in my screen) the loop - endloop should exit at that line. for example : if i select