hello,

I'm using restlet 2.0 and I've issues with   the HTTPS for my client 
application.

I'm testing on a localhost, so my client and my server are on the same computer.

The aim of my application is to put some information into a database.

When I launch my client application I get the following error :

java.io.IOException: Invalid keystore format
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
    at
sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    at
org.restlet.engine.http.StreamClientHelper.createSecureSocketFactory(StreamC
lientHelper.java:187)
    at
org.restlet.engine.http.StreamClientHelper.createSocketFactory(StreamClientH
elper.java:258)
    at
org.restlet.engine.http.StreamClientHelper.create(StreamClientHelper.java:15
3)
    at
org.restlet.engine.http.HttpClientAdapter.toSpecific(HttpClientAdapter.java:
522)
    at
org.restlet.engine.http.HttpClientHelper.handle(HttpClientHelper.java:106)
    at org.restlet.Client.handle(Client.java:223)
    at org.restlet.resource.ClientResource.handle(ClientResource.java:583)
    at org.restlet.resource.ClientResource.handle(ClientResource.java:558)
    at org.restlet.resource.ClientResource.get(ClientResource.java:392)
    at client.ClientMain.main(ClientMain.java:96)


I've re-generate the jks file but the error is still there.

I've tried to use the application in a browser (after implementing a get
method) and I didn't get the error, put when I tried the get in the client, the 
error is back again.

Have I missed something in the https configuration of my client?

Please find below the details of my client application:

public class ClientMain {

    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws IOException,
            ResourceException {
       
        ClientResource itemsResource = new ClientResource(
                "https://localhost:8283/items";);

        itemsResource.setChallengeResponse(ChallengeScheme.HTTP_BASIC,
"root", "root");

           
        /*partie facture*/
        JSONObject json = new JSONObject();
        json.put("Client_id", "80");
        json.put("Denomination", "rien du tout");
       
        /*Partie sous facture*/
        String[][] lignes_factures = new String[1][4];

        lignes_factures[0][0] = "Facture 1";
        lignes_factures[0][1] = "Achat de croquettes";
        lignes_factures[0][2] = "60";
        lignes_factures[0][3] = "600";
       

        json.put("lignes_associƩes", lignes_factures);

    /*Representation r = */ itemsResource.post(getRepresentation(json));

    }


    @SuppressWarnings("unchecked")
    public static Representation getRepresentation(JSONObject json) {

        Representation rep = new JsonRepresentation(json);
        return rep;
       
    }

}


Thanks by advance for your help.

Kind regards,

Laurent Garrigues

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2385623

Reply via email to