t-markmann / nc-userimporter

This tool creates Nextcloud users from a CSV file, which you exported from some other software or created with a spreadsheet software. To disable/enable/delete users, try: https://github.com/t-markmann/nc-usermanager
GNU General Public License v3.0
64 stars 22 forks source link

HTTPSConnectionPool SSL: CERTIFICATE_VERIFY_FAILED #10

Closed megaherox closed 4 years ago

megaherox commented 4 years ago

When i using nc-userimporter.exe on windows following error came up:

HTTPSConnectionPool(host='censored', port=9443): Max retries exceeded with url: /ocs/v1.php/cloud/groups?search=censored (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)')))

I am using a buyed SSLCert. So its not self singed!

t-markmann commented 4 years ago

Do you use an alternative port at your webserver? 9443 is often used, if 443 is used by another service.

The client will use 443 by default for the https connection. Currently we can not set a custom port or deactivate https, we would have to develop that.

megaherox commented 4 years ago

Yeah, we use port 9443. Port 443 is used by another service. But in the CMD the Error says Port 9443 ? Are you sure that the client will default use 443 when i have in the config.xml following url=YOUR-CLOUD-URL:9443 ? So without :9443 the Error Message will change to port=443

t-markmann commented 4 years ago

I just tried an existing setup on port 7443 and a Letsencrypt cert. This worked well. I can only take guesses about the problem... do you have another Windows system or even a Linux/Mac to test?

To provide a working package for your situation I uploaded a Windows package here with SSL verification turned off: https://get.edudocs.org/de/assets/nc-userimporter/nc-userimporter_win_no-ssl-verify.zip You will get a warning that this is not good, but hopefully it works for you.

megaherox commented 4 years ago

Thank you for the no SSL Package (: ! I tried with your new Windows Package, now the Error is gone ! But the Script do nothing. I have in the Config a Admin User with a Password that is correct. (without special characters !) And also in the Users File Users but on my Nextcloud 17 there a no users... Also i have no Log File.. We have Linux an Windows, so i can test on both.. But Windows is our preferred System.

next01

next02

t-markmann commented 4 years ago

Nothing happens? So the terminal window just opens and closes right after that?

Try the following: go into your windows shell (press WIN+R, then type "cmd"). Now cd into your nc-userimporter directory and execute nc-userimporter.exe

The shell will remain open even if there are unhandled errors.

megaherox commented 4 years ago

next03

t-markmann commented 4 years ago

You found a case we did not test ;-) Alright, I made a new build, please try: https://get.edudocs.org/de/assets/nc-userimporter/nc-userimporter_win_no-ssl-verify.zip

Here we catch that bug. We have to refactor the whole thing at some time.

megaherox commented 4 years ago

Now its working 👍 The User is correctly created and i have a pdf file (: Thank you for the fast fix. Will there be a version with SSL on ?

t-markmann commented 4 years ago

Great, you're welcome! SSL is currently always on. Just the verification is turned off in this branch.