I am using poplib to receive email but my computer accesses internet via http proxy. It seems that poplib does not support proxy? How to use poplib using http proxy? Many thanks!
Related
We have a requirement to invoke an external API which would require authentication of our internal corporate proxy through kerberos.
Earlier our proxy server accepted basic authentication so building proxy using my username and password worked. But now we are asked to use kerberos authentication
Earlier our proxy server accepted basic authentication so below code worked for me.
Proxy = {"http": f"http://user:password#proxy_server:proxy_port,
"https": f"https://user:password#proxy_server:proxy_port"}
How can we achieve this using kerberos authentication?
From what I can see in the Python documentation for the ssl module, there is no control over how the Client Hello is sent to the server. Moreover, since the Encrypted Client Hello extension to the TLS protocol is somewhat experimental, with Firefox only supporting it via a hidden about:config option.
That being said, is there a way to create a connection to an SSL/TLS server with an Encrypted Client Hello from Python today? If possible, I would prefer answers that use the requests library so that it can be immediately applied to connecting to HTTPS endpoints.
Need help to send mail `(smtp.gmail.com)` through proxy settings.
Not working even after trying multiple libraries (Including socks)
Latest - Using `xsmtplib`.. but getting following error.
The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy)
Any help will be really appreciated.
Below code for connecting with SMTP server via Proxy
"""from xsmtplib import SMTP
server = SMTP(proxy_host,proxy_port,host,port,timeout)
server.sendmail("aaaa#gmail.com", "bbbb#gmail.com", "Test Msg")
server.quit()"""
You can use xsmtplib, an extension of standard smtplib, which supports proxy tunneling.
I'm being trying to
Log into a server using SHH (with Paramiko)
Use that connection like a proxy and route network traffic through it and out to the internet. So say I could set it as my proxy in Urllib2, Mechanize, Firefox, etc.).
Is the second part possible or will I have to have some sort of proxy server running on the server to get this to work?
You could implement a SOCKS proxy in the paramiko client that routes connections across the SSH tunnel via paramiko's open_channel method. Unfortunately, I don't know of any out-of-the-box solution that does this, so you'd have to roll your own. Alternatively, run a SOCKS server on the server, and just forward that single port via paramiko.
I installed requests.
But I can not send https request, even as simple as this:
requests.get('https://www.google.com')
The error message is:
_ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
UPDATES: I can send https request using other method, urllib2, httplib can send https request sucessfully
This is not a problem with requests, or even with Python.
You are most likely using a proxy server that has not been properly configured to handle SSL connections. The exact problem is very much dependent on the proxy server. A Google search on the 140770FC error will give you many hits and discussions on how to diagnose this.
Note that even if you have not configured a proxy on your local machine, a corporate firewall could still be forcing HTTPS connections to go over a proxy at the network boundaries.