HTTPUnit not working against an https (SSL) site

S

Sam

I am trying to test a request/response from a https address and
getting the error

java.lang.RuntimeException: https support requires the Java Secure
Sockets Extension. See http://java.sun.com/products/jsse

I have the jdk version 1.4.2_05 which says the JSSE is now part of the
jdk.

I also have

security.provider.2=com.sun.net.ssl.internal.ssl.Provider

in my java.security file.

What am I doing wrong?

Thanks in advance

Sam
 
B

Bruno Grieder

Sam said:
I am trying to test a request/response from a https address and
getting the error

java.lang.RuntimeException: https support requires the Java Secure
Sockets Extension. See http://java.sun.com/products/jsse

I have the jdk version 1.4.2_05 which says the JSSE is now part of the
jdk.

I also have

security.provider.2=com.sun.net.ssl.internal.ssl.Provider

in my java.security file.

What am I doing wrong?

Thanks in advance

Sam


Mhh... Strange. I am using the same version without any issue (on Linux)
and I confirm that (contrarily to 1.3) there is no set-up to do at all
to use the default Sun libraries. I have tried with the Apache
httpclient librairies with similar success.

Are you sure you are actually using HTTPSUrlConnections or opening
SSLSockets when connecting?

bruno
 
S

samotto

I am not sure if I am using HTTPSUrlConnections or SSLSockets. How do
I tell?

We have a dev site and a production site. When I set the request to
go to the dev site (with http:// in the url) everything works. When I
change the request url to our prod site (with https://) I get the
error.

So do I need to change something else in my code to the the HTTPS
stuff?

Thanks for your time...

Sam
 
B

Bruno Grieder

samotto said:
I am not sure if I am using HTTPSUrlConnections or SSLSockets. How do
I tell?

We have a dev site and a production site. When I set the request to
go to the dev site (with http:// in the url) everything works. When I
change the request url to our prod site (with https://) I get the
error.

So do I need to change something else in my code to the the HTTPS
stuff?

Thanks for your time...

Sam

Yes you do have to change something.

for http you shoud do something like
HttpUtlConnection conx = (HttpUrlConnection) (new
URL("http://...)).openConnection();

for https
HttpsUrlConnection conx = (HttpsUrlConnection) (new
URL("https://...)).openConnection();


bruno

nb: please bottom post.
 
S

samotto

Bruno,

I am using HTTPUnit. Below is the code to get a connection:

wc = new WebConversation();

WebRequest request = new GetMethodWebRequest(
"http://www.development.com" );
//WebRequest request = new GetMethodWebRequest(
"https://www.production.com" );

The commented out line above will not work.

Also, on your suggestion, it appears that the constructors for
HttpsURLConnection and HttpURLConnection are protected so there must
be some other way the are created. I have not worked much with the
java.net package.

It has to be something in HTTPUnit I am not doing right.

Thanks again

Sam
 
B

Bruno Grieder

samotto said:
Bruno,

I am using HTTPUnit. Below is the code to get a connection:

wc = new WebConversation();

WebRequest request = new GetMethodWebRequest(
"http://www.development.com" );
//WebRequest request = new GetMethodWebRequest(
"https://www.production.com" );

The commented out line above will not work.

Also, on your suggestion, it appears that the constructors for
HttpsURLConnection and HttpURLConnection are protected so there must
be some other way the are created. I have not worked much with the
java.net package.

It has to be something in HTTPUnit I am not doing right.

Thanks again

Sam

Sam,

I do not use HttpUnit, only the Sun default implementation and Apache
HHTPClient. I am afraid I cannot help you with this one;

Constructors protected: yes, these classes should not be instantiated
directly; that is why I said you should use:

HttpsUrlConnection conx = (HttpsUrlConnection) (new
URL("https://...)).openConnection();

bruno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top