0

I want to make an android app to do a login on the website of my school, the problem that I have is that the website works with HTTPS protocol and it has a self-signed protocol.

I have been searching how can I perform the login doing a scrapping of the website with JSOUP but when try to connect to the website I got the next error

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

I've seen this site and also this site but i'm a little bit confused

What i want that you can help me is that if you have some kind of code that make it easier do the login or how can I do this in an easier way.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Jonathan Axel
  • 67
  • 2
  • 6
  • If its a self signed HTTPS cert, you'll probably have to download the HTML first yourself, using eg. HttpUrlConnection, and then parse with jsoup. – Jonas Czech Dec 26 '15 at 14:09

1 Answers1

0

Usually login into a web site requires two steps -
1. You send a get request to get the page, and you extract from there some values like session ID etc, and the cookies.
2. You send a post request with the values from step 1, and your user name and password.
To know which values you need to send, use your browser in the developer mode (by pressing F12) and examine the traffic. If you want to write an android app, change the user agent string to match your browser, since some sites send different pages to different clients. You can see an example here.

Community
  • 1
  • 1
TDG
  • 5,909
  • 3
  • 30
  • 51
  • Thank you, that's what I was looking for. I had implemented the example and it worked. Now i am facing another problem with download captcha image, but that is gonna be in another question. – Jonathan Axel Dec 27 '15 at 20:04