Https Connection in MIDP

Hi All,

I could successfully run the application as given in the http://developers.sun.com/techtopics/mobility/midp/articles/https/.

Am using tomcat server. i have the entry in server.xml as

In c:\tomcat\conf\server.xml remove the comment marks from the SSL HTTP/1.1 Connector entry as follows:

<!-- Define an SSL HTTP/1.1 Connector on port 8443 -->

<Connector className="org.apache.catalina.connector.http.HttpConnector"

port="443" minProcessors="5" maxProcessors="75"

enableLookups="true"

acceptCount="10" debug="0" scheme="https" secure="true">

<Factory className="org.apache.catalina.net.SSLServerSocketFactory"

clientAuth="false" protocol="TLS"/>

</Connector>

If "clientAuth" is false then i'm getting response successfully. but when "clientAuth" is true i got the following exception

java.io.IOException: No client cert

at com.sun.midp.ssl.Handshake.sndKeyExch(+27)

at com.sun.midp.ssl.Handshake.doHandShake(+170)

at com.sun.midp.ssl.SSLStreamConnection.<init>(+157)

at com.sun.midp.io.j2me.https.Protocol.connect(+214)

at com.sun.midp.io.j2me.http.Protocol.streamConnect(+57)

at com.sun.midp.io.j2me.http.Protocol.startRequest(+12)

at com.sun.midp.io.j2me.http.Protocol.sendRequest(+38)

at com.sun.midp.io.j2me.http.Protocol.sendRequest(+6)

at com.sun.midp.io.j2me.http.Protocol.closeOutputStream(+4)

at com.sun.midp.io.BaseOutputStream.close(+14)

at com.mportal.familymonitor.communication.ConnectionHandler.post(+151)

at com.mportal.familymonitor.control.Manager.run(+132)

what is clientAuth? Should it be always "false" ?

looking forward your replies.

regards

ss

[1796 byte] By [J2ME_BLRa] at [2007-11-26 18:53:22]
# 1

Hi,

there are two things, that you usually associate with the use of ssl:

1.) Encryption (your connection to the server is encrypted)

2.) Server certification (in IE you see some sort of lock in the status line). If you click on it a window pops up and you can verify the servers certificate chain.

However ssl also allows the certification of the browser (client). I.e. if you as developer want to make sure, that the connected browser is indeed allowed to see certain pages or make certain actions, you can ask for a browsers certificate.

So if you need a connector for actions that should only be called from certain users on certain machines, you can import their certifcates into your servers trust store and set clientAuth to true for this connector. Than only those browsers can connect to this connector.

g_magossa at 2007-7-9 6:27:23 > top of Java-index,Java Essentials,Java Programming...