Certificate protected website(URL)

I am trying to access data from a website (https://oasis.midwestiso.org/documents/miso/outage_reports.asp)

but this site is protected by a certificate. I do have the certificate. I want to know how to install the certificate and how to access the website data with my program. Code or websites would be much appreciated.

Best regards.

[354 byte] By [ckrulza] at [2007-11-27 10:24:47]
# 1

There're a Certificate class and CertificateFactory class located in java.security.cert; you might want to check these out. I'm not sure how helpful they'll be, as I have never done anything pertaining to what you're doing, but they might be a good place to start.

http://java.sun.com/javase/6/docs/api/index.html?java/security/cert/Certificate.html

http://java.sun.com/javase/6/docs/api/index.html?java/security/cert/CertificateFactory.html

Djaunla at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...
# 2

> I am trying to access data from a website

> (https://oasis.midwestiso.org/documents/miso/outage_re

> ports.asp)

> but this site is protected by a certificate. I do

> have the certificate. I want to know how to install

> the certificate and how to access the website data

> with my program. Code or websites would be much

> appreciated.

>

You have aq website running asp that you want to install a certificate on.

So what part of this question has anything to do with Java exactly?

cotton.ma at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...
# 3

well i have a java program that connects to a website the one mentioned above and tries to scrape data. Now to access this website a certificate is required. which i do have. But i dont know how to connect to the website with the certificate and stuff like that. So do let me know anything that could help me on the same.

ive used

URL url = new URL(source);

HttpsURLConnection uc = (HttpsURLConnection) url.openConnection();

and the regular stuff like the buffered stream... then readLine()

then used the setRequestProperty ()

to set some cookies

but all i can read from the page is that i need to access the page with a certificate.(no errors tho)

Message was edited by:

ckrulz

ckrulza at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...
# 4

Ah. Well that's an interesting question to which I can only answer I don't really know.

However have you tried the obvious of making the importing the certificiate into the keystore? That may make it magically send it along then. Maybe.

Well it's a first step anyway.

cotton.ma at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...
# 5

If you are really stuck you might consider reposting this question in the security forum. If you do then please post a link here to that thread.

Ask what you said in your reply though, not the first post which was confusing. But your reply contains your real problem.

I do think though that I may be right.. adding the certificate to the keystore may be enough.

cotton.ma at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...
# 6

hey colton i tried working around that though it keeps givin me the error file not found when i try to import the certificate

the certificate is on my desktop so i ran this command

C:\Program Files\Java\jre1.6.0_01\bin>keytool -import -alias karl -keystore %JAVA_HOME%\jre\lib\security\cacerts -file

mycert.cer

note: i havent made my own keystore and stuff like that!!

well i dont know any procedure as such could you let me know of

1. steps to create a keystore

2. steps how to import the certificate

3.anything else !!

thanks a lot for your replies!!Appreciate your help

ckrulza at 2007-7-28 17:29:56 > top of Java-index,Java Essentials,Java Programming...