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

Update certifi and SSL Certificates, and below issue #231

Open
SHIFTABINKHALID opened this issue Jan 24, 2025 · 6 comments
Open

Update certifi and SSL Certificates, and below issue #231

SHIFTABINKHALID opened this issue Jan 24, 2025 · 6 comments

Comments

@SHIFTABINKHALID
Copy link
Contributor

Requesting access to Google...
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 716, in urlopen
httplib_response = self._make_request(
conn,
...<5 lines>...
chunked=chunked,
)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 404, in _make_request
self._validate_conn(conn)
~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 1061, in validate_conn
conn.connect()
~~~~~~~~~~~~^^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connection.py", line 419, in connect
self.sock = ssl_wrap_socket(
~~~~~~~~~~~~~~~^
sock=conn,
^^^^^^^^^^
...<8 lines>...
tls_in_tls=tls_in_tls,
^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\util\ssl
.py", line 458, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
sock, context, tls_in_tls, server_hostname=server_hostname
)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\util\ssl
.py", line 502, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
sock=sock,
^^^^^^^^^^
...<5 lines>...
session=session
^^^^^^^^^^^^^^^
)
^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\ssl.py", line 1076, in _create
self.do_handshake()
~~~~~~~~~~~~~~~~~^^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\ssl.py", line 1372, in do_handshake
self._sslobj.do_handshake()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
method=request.method,
...<9 lines>...
chunked=chunked,
)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\connectionpool.py", line 802, in urlopen
retries = retries.increment(
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\urllib3\util\retry.py", line 594, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='android.clients.google.com', port=443): Max retries exceeded with url: /auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\user\Desktop\hope\whapa-master\libs\whagodri.py", line 617, in
wa_backup = WaBackup(**getConfigs())
File "C:\Users\user\Desktop\hope\whapa-master\libs\whagodri.py", line 43, in init
token = gpsoauth.perform_master_login(email=gmail, password=password, android_id=android_id)
File "C:\Users\user\Desktop\hope\whapa-master\libs\gpsoauth_init_.py", line 138, in perform_master_login
return perform_auth_request(data, proxy)
File "C:\Users\user\Desktop\hope\whapa-master\libs\gpsoauth_init
.py", line 81, in _perform_auth_request
res = session.post(AUTH_URL, data=data, verify=True)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\requests\adapters.py", line 698, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='android.clients.google.com', port=443): Max retries exceeded with url: /auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)')))

@SHIFTABINKHALID
Copy link
Contributor Author

anyone to assist here.

@Rikysonic
Copy link

Rikysonic commented Jan 28, 2025

In doc/requirements.txt change requests with requests==2.29.0, then reinstall requirements

@SHIFTABINKHALID
Copy link
Contributor Author

In doc/requirements.txt change requests with requests==2.29.0, then reinstall requirements

Thanks so much it worked.Still having a new problem

-------------- Whatsapp Google Drive Extractor --------------

[i] Searching...

Requesting access to Google...
Failed
{'Error': 'BadAuthentication'}

Workaround

  1. Check that your email and password are correct in the settings file.
  2. Your are using a old python version. Works >= 3.8.
  3. Update requirements, use in a terminal: 'pip3 install --upgrade -r ./doc/requirements.txt' or 'pip install --upgrade -r ./doc/requirements.txt
  4. Your OAuth token configured in the settings file may have expired. The token will be deleted and you will have to log in again.

I've fulfilled all required requirements and still getting the above

@Rikysonic
Copy link

It's better not to login through whapa with user/pass, but instead manually get the OAuth2 token from browser (follow this guide) and then perform the OAuth cookie login - basically skipping everything from line 42 to line 96 inside libs/whagodri.py.
You can add a parameter to pass the OAuth2 cookie value directly to the function and make it use to perform the authentication.
This is what I did:

if not oauth_token and oauth_token_basic:
    print("Requesting access to Google by OAuth cookie...")
    token = gpsoauth.perform_master_login_oauth(email=gmail, oauth_token=oauth_token_basic, android_id=android_id)
    if "Token" not in token:
        error(token)
        quit()
    else:
        print("Granted.")
        print("Writing Token in your settings.cfg file...")
        cfg_file = r'{}/cfg/settings.cfg'.format(whapa_path).replace("/", os.path.sep)
        config = ConfigObj(cfg_file, interpolation=None)
        config['google-auth']['oauth'] = token['Token']
        config.write()
        oauth_token = token['Token']

oauth_token_basic is the new variable I added in cfg file. I added oauth_token_basic = config['google-auth']['oauth_basic'] in method getConfigs to make it load the variable from configuration file.

@SHIFTABINKHALID
Copy link
Contributor Author

It's better not to login through whapa with user/pass, but instead manually get the OAuth2 token from browser (follow this guide) and then perform the OAuth cookie login - basically skipping everything from line 42 to line 96 inside libs/whagodri.py. You can add a parameter to pass the OAuth2 cookie value directly to the function and make it use to perform the authentication. This is what I did:

if not oauth_token and oauth_token_basic:
    print("Requesting access to Google by OAuth cookie...")
    token = gpsoauth.perform_master_login_oauth(email=gmail, oauth_token=oauth_token_basic, android_id=android_id)
    if "Token" not in token:
        error(token)
        quit()
    else:
        print("Granted.")
        print("Writing Token in your settings.cfg file...")
        cfg_file = r'{}/cfg/settings.cfg'.format(whapa_path).replace("/", os.path.sep)
        config = ConfigObj(cfg_file, interpolation=None)
        config['google-auth']['oauth'] = token['Token']
        config.write()
        oauth_token = token['Token']

oauth_token_basic is the new variable I added in cfg file. I added oauth_token_basic = config['google-auth']['oauth_basic'] in method getConfigs to make it load the variable from configuration file.

You have the latest version
File "C:\Users\user\Desktop\hope\whapa-master\libs\whagodri.py", line 244
if not oauth_token and oauth_token_basic:
SyntaxError: expected 'except' or 'finally' block
File "C:\Users\user\Desktop\hope\whapa-master\libs\whagodri.py", line 244
if not oauth_token and oauth_token_basic:
SyntaxError: expected 'except' or 'finally' block
File "C:\Users\user\Desktop\hope\whapa-master\libs\whagodri.py", line 244
if not oauth_token and oauth_token_basic:
SyntaxError: expected 'except' or 'finally' block

this is what I got after adding

if not oauth_token and oauth_token_basic:
print("Requesting access to Google by OAuth cookie...")
token = gpsoauth.perform_master_login_oauth(email=gmail, oauth_token=oauth_token_basic, android_id=android_id)

if "Token" not in token:
    error(token)
    quit()
else:
    print("Granted.")
    print("Writing Token in your settings.cfg file...")
    cfg_file = r'{}/cfg/settings.cfg'.format(whapa_path).replace("/", os.path.sep)
    config = ConfigObj(cfg_file, interpolation=None)
    config['google-auth']['oauth'] = token['Token']
    config.write()
    oauth_token = token['Token']

@falsacoc3
Copy link

No soy muy bueno en esto, quisiera ayuda ya que desde el final del año 2024 dejo de funcionar el aplicativo y no entiendo el por que de la falla:

Requesting access to Google...
Traceback (most recent call last):
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 716, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 404, in _make_request
self._validate_conn(conn)
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 1061, in validate_conn
conn.connect()
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 419, in connect
self.sock = ssl_wrap_socket(
^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl
.py", line 458, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl
.py", line 502, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1075, in _create
self.do_handshake()
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1346, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 802, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\retry.py", line 594, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='android.clients.google.com', port=443): Max retries exceeded with url: /auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ronal\Desktop\h\whapa-master\whapa-master\libs\whagodri.py", line 617, in
wa_backup = WaBackup(**getConfigs())
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\Desktop\h\whapa-master\whapa-master\libs\whagodri.py", line 43, in init
token = gpsoauth.perform_master_login(email=gmail, password=password, android_id=android_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\Desktop\h\whapa-master\whapa-master\libs\gpsoauth_init_.py", line 138, in perform_master_login
return perform_auth_request(data, proxy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\Desktop\h\whapa-master\whapa-master\libs\gpsoauth_init
.py", line 81, in _perform_auth_request
res = session.post(AUTH_URL, data=data, verify=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ronal\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 698, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='android.clients.google.com', port=443): Max retries exceeded with url: /auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')))

Si pueden ayudarme se los agradeceria mucho

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

3 participants