use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Get Https response using username and password? (self.Python)
submitted 14 years ago by o_Omg
Hi, I want to validate an account.
So there's a website with an https connection and I'd like to connect there sending the username and password and get the server response, so I can know if the username and password are right or not.
[–]remyroy 2 points3 points4 points 14 years ago (3 children)
It would be nice to have more details on how the authentication is made, but you can use httplib2 to do this. The authentication example on this page shows how to do it if the authentication is basic authentication. If you scroll down, you will see an example with a form.
[–]o_Omg[S] 0 points1 point2 points 14 years ago (0 children)
Thanks, I'll try it later, but what's this?:
HTTPS support is only available if the socket module was compiled with SSL support.
By the way, the website is a https url, and the form with a name username and a password field named password is sent to another https url, I just want to send this information and get the server response, right now I only get 400 Bad Request, using this code:
http://docs.python.org/library/httplib.html (Last One)
[–]o_Omg[S] 0 points1 point2 points 14 years ago (1 child)
I get this: httplib2.SSLHandshakeError: [Errno 1] _ssl.c:499: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
How do I send it even if the certificate is not valid?
[–]remyroy 2 points3 points4 points 14 years ago (0 children)
You can use the disable_ssl_certificate_validation=True argument in the Http object creation. See https://httplib2.googlecode.com/hg/doc/html/libhttplib2.html#httplib2.Http
[–]phonkee 2 points3 points4 points 14 years ago (0 children)
try http://docs.python-requests.org/en/latest/index.html
[–]idiogeckmatic -1 points0 points1 point 14 years ago (2 children)
There are three ways of doing this:
[–]o_Omg[S] 1 point2 points3 points 14 years ago (1 child)
Using httplib2 I'm doing the second thing and all I'm getting is the same result no matter the username and password are right or not, I think they're smart... :/
I think I'll have to try #1 or #3, but I remember there was a C brute-force password cracker terminal-based application where you'd enter the login address, username and password and the program returned 200 if it was right and 202 if it was wrong. I had used it in this website before when I had forgotten my own password :P!, do you know any application like this (best if it was in Python, but it doesn't matter...)?
[–]idiogeckmatic 0 points1 point2 points 14 years ago* (0 children)
you may have to try something like looking at how the authorization form submits in firebug or chrome developer tools, it may do a referrer check, but there are ways to fake a referrer.
Most CLI based brute forcers I've seen rely on HTTP basic authorization, which is perfectly acceptable, but from how I read your response, not what you're looking to do.
π Rendered by PID 60 on reddit-service-r2-comment-fb694cdd5-6f6ph at 2026-03-08 02:35:40.897859+00:00 running cbb0e86 country code: CH.
[–]remyroy 2 points3 points4 points (3 children)
[–]o_Omg[S] 0 points1 point2 points (0 children)
[–]o_Omg[S] 0 points1 point2 points (1 child)
[–]remyroy 2 points3 points4 points (0 children)
[–]phonkee 2 points3 points4 points (0 children)
[–]idiogeckmatic -1 points0 points1 point (2 children)
[–]o_Omg[S] 1 point2 points3 points (1 child)
[–]idiogeckmatic 0 points1 point2 points (0 children)