https protocol with http plugin

I’m trying to get to a webservice with the http plugin. The service runs on a server with a security certificate. Therefore I created a script like this:

var httpmsg = plugins.http.createNewHttpClient();
var postmsg = httpmsg.createPostRequest(‘https://www.someservice.nl/api/etc/ect/request’);
postmsg.addHeader(‘Extra-header’, securitykey);
respons = postmsg.executeRequest();

When I do this the respons on this URL is always ; while doing it in a browser gives a valid (and logic) respons.

I checked with the http plugin and it seems that roughly 9 out of 10 “https” (not http) url’s all give when fired with:

plugins.http.getPageData(url);

Is there an issue with security certificates? I’m sure the certificate on this server I try to reach is a valid one and paid for.

Anyone any suggestions?

Check the log file, it should give you more info.

Ok the log says:
2013-01-18 08:10:24,985 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable [EEC7EBD9-C9F0-472D-934F-6175D8BFCCF9 ASSYST]
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

So the connection is blocked because of the certificate: “peer not authenticated”(?)
Why the browserbean can connect the same url without explicit authentication?
What should we do do connect to this url with the http plugin?

Yes.
I don’t know what method the browser bean uses to authenticate certificates.
But the HTTP plugin uses the Java security list. I had the same problem with my test site using a self signed certificate, I had to manually add this certificate to the Java security list (don’t ask me how it’s been a while ago). But you said it was a valid certificate so maybe it can only validated online, you can try setting this option in the Java control panel (Advanced tab-> security → general → Eneable online certificate validation). I don’t know if this works I haven’t tried this and I’m not an expert on this.

Hope this helps,

Thanks for your answer. I tried that setting in the java prefs. No difference.
The certificate is worldwide accepted; it is even in the list of trusted certificates in the java prefs pane…
This is very frustrating.

Have a look at this article:

This happens also with certificates from (crappy/free)StartSSL, they are accepted by browsers, but not with Java

The article Jeroen supplied was very helpfull. The server admin changed the installation of the certificate so now the entire chain is valid for java.
It looks like this problem occurs on about 9 out of 10 https servers. Java should do something about it or may be Servoy can do something to make sure Servoy solutions can work with it?