Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with https website #25

Closed
InfoLibre opened this issue Feb 9, 2020 · 10 comments
Closed

Problem with https website #25

InfoLibre opened this issue Feb 9, 2020 · 10 comments

Comments

@InfoLibre
Copy link
Contributor

InfoLibre commented Feb 9, 2020

I've got this error when I test Pombo and nothing else seems to occur :

sudo -H /usr/local/bin/pombo.py
Pombo 1.0.3
/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)

Perhaps it is because of the automatic redirection from http to https made by Apache ?

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

Yes, and the certificate maybe not official perhaps?

@InfoLibre
Copy link
Contributor Author

I'm not sure but the certificate seems to be official :
server_url=https://infolib.re/pombo/david/index.php

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

You are right. Maybe a Python 2 issue 🤔
Can you try with Python 3 instead?

@InfoLibre
Copy link
Contributor Author

I installed python3 :
sudo apt-get install python3-minimal python3-ipy python3-requests net-tools iw traceroute scrot streamer gpg
And replaced #!/usr/bin/env python by #!/usr/bin/env python3 in /usr/local/bin/pombo.py and I've still the same https error :

$ sudo -H /usr/local/bin/pombo.py
Pombo 1.0.3
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

Hm I cannot reproduce on Python 2.7.16 nor 3.7.4.

For Python 2 and 3, what is the output of that command?

import sys
import requests

print(sys.version)
print(requests.get("https://infolib.re/pombo/david/index.php").text)

@InfoLibre
Copy link
Contributor Author

InfoLibre commented Feb 18, 2020

$ python
Python 2.7.17 (default, Nov  7 2019, 10:07:09) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import requests
>>> print(sys.version)
2.7.17 (default, Nov  7 2019, 10:07:09) 
[GCC 7.4.0]
>>> print(requests.get("https://infolib.re/pombo/david/index.php").text)
Nothing to do ...
>>> 

$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import requests
>>> print(sys.version)
3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0]
>>> print(requests.get("https://infolib.re/pombo/david/index.php").text)
Nothing to do ...
>>>

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

And what about the same commands using sudo -H?

@InfoLibre
Copy link
Contributor Author

$ sudo -H python
[sudo] Mot de passe de  :
Python 2.7.17 (default, Nov  7 2019, 10:07:09) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import requests
>>> print(sys.version)
2.7.17 (default, Nov  7 2019, 10:07:09) 
[GCC 7.4.0]
>>> print(requests.get("https://infolib.re/pombo/david/index.php").text)
Nothing to do ...
>>> 

$ sudo -H python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import requests
>>> print(sys.version)
3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0]
>>> print(requests.get("https://infolib.re/pombo/david/index.php").text)
Nothing to do ...
>>> 

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

I think I found the error:

pombo/pombo.py

Line 401 in 7ab3ddb

ssl_cert_verif = url.split(':') == 'https'

>>> "https://infolib.re/pombo/david/index.php".split(":")
['https', '//infolib.re/pombo/david/index.php']
>>> "https://infolib.re/pombo/david/index.php".split(":") == "https"
False

This is a long-time bug then ... 😨

@BoboTiG
Copy link
Owner

BoboTiG commented Feb 18, 2020

But this is just a warning, the sofwate should work with it too. I will fix it quickly though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants