# NC connection wizard tries to access token endpoint via http instead of https

**URL:** <https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111>\
**Category:** 💻 Desktop\
**Tags:** nc18-nextcloud-hub\
**Created:** [April 24, 2020, 10:18am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111 "2020-04-24T10:18:34Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![banjo42](https://help.nextcloud.com/letter_avatar/banjo42/32/5_5575768a8748004e209b776fc1b2916d.png) [@banjo42](https://help.nextcloud.com/u/banjo42)\
**Post date:** [April 24, 2020, 10:18am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/1 "2020-04-24T10:18:34Z")

</div>

I have a working Nextcloud 18.0.3 installation on my synology server (OS: DSM 6.2.2-24922 Update 4) which is already connected to 3 clients including my smartphone. Now I would like to connect an additional Windows 10 Home 32 bit client  
The browser access (like [https://mydomain.de:12345](https://mydomain.de:12345)) works fine from that machine.  
When connecting with the connection wizard of nextcloud client (2.6.4 stable Win 32)  
I see this error message.

```auto
    Fehler beim Zugriff auf den Token' -Endpunkt:
    Error transferring http://mydomain.de:12345/login/v2/poll - server replied: Bad Request

```

The wizard tries to use http instead of https. However my nextcloud server is not reachable via http from internet.  
How to overcome the blockage?

REM 1: As a possible outcome I already had tried to find out how to rewrite http access to https on Nextcloud side, but my Google search was not successful here. Actually, for me that is not so important as the Nextcloud instance is for private use mainly. And as far as I remember there was a form in the earlier connection wizard where I could enter the correct URL with leading https://  
REM 2: As I can access Nextcloud in my local network with [http://192.168](http://192.168)…:8090 I used this as a workaround. But obviously this is a local network solution only. Probably I could configure my router to forward the external requests to the http port, but that is not what I want due to security concerns.  
Over all the token access via http could be a bug.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [April 24, 2020, 12:21pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/2 "2020-04-24T12:21:39Z")

</div>

Ideally you have a redirect for https. Not sure why it doesn’t use https per default (and http as fall-back). The login-flow documentation uses https: [https://docs.nextcloud.com/server/latest/developer\_manual/client\_apis/LoginFlow/index.html](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html)

You’ll probably have to ask the developers: [https://github.com/nextcloud/desktop](https://github.com/nextcloud/desktop)

---

<div class="post-metadata">

**Author:** ![banjo42](https://help.nextcloud.com/letter_avatar/banjo42/32/5_5575768a8748004e209b776fc1b2916d.png) [@banjo42](https://help.nextcloud.com/u/banjo42)\
**Post date:** [April 24, 2020, 6:18pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/3 "2020-04-24T18:18:37Z")

</div>

Hi Tflidd  
Thank you very much for your reply  
I checked login-flow documentation chapter ‘Login flow v2’  
[https://docs.nextcloud.com/server/latest/developer\_manual/client\_apis/LoginFlow/index.html#login-flow-v2](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2)  
That is all about https.  
And in the German installation guide I used one year ago ( [https://www.heise.de/ratgeber/Nextcloud-als-Docker-Instanz-im-NAS-einrichten-4199681.html](https://www.heise.de/ratgeber/Nextcloud-als-Docker-Instanz-im-NAS-einrichten-4199681.html) ) I found this:  
“Mit einem ReverseProxy-Eintrag im NAS leitet nginx HTTPS Verbindungswünsche an den Nextcloud Container weiter, der selbst nur HTTP spricht”  
(“With a reverse proxy entry in the NAS, nginx forwards HTTPS connection requests to the NextCloud container, which itself only speaks HTTP”)  
Probably this reverse proxy is misconfigured not the wizard.

---

<div class="post-metadata">

**Author:** ![Don\_Robertson](https://help.nextcloud.com/user_avatar/help.nextcloud.com/don_robertson/32/44321_2.png) [@Don\_Robertson](https://help.nextcloud.com/u/Don_Robertson)\
**Post date:** [July 2, 2020, 12:18am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/4 "2020-07-02T00:18:40Z")

</div>

Just started getting this today - no problems with android clients just Linux desktop clients. Suddenly becomes unusable. No other changes to networks that I am aware of.

---

<div class="post-metadata">

**Author:** ![Mstena19](https://help.nextcloud.com/letter_avatar/mstena19/32/5_5575768a8748004e209b776fc1b2916d.png) [@Mstena19](https://help.nextcloud.com/u/Mstena19)\
**Post date:** [August 10, 2020, 11:19pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/5 "2020-08-10T23:19:43Z")

</div>

Hi guys,

I just had a similar situation on my nextcloud docker (port 80) behind nginx proxy (serving https on non-standard 9876) and redirecting to nextcloud http:80 backend). In case your setup is similar, just add this to your nginx config:

`proxy_set_header Host $http_host;`  
#I use this to prevent port change on redirect  
#alternatively use the common  
#proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
#this preserves the initial protocol, the https…

after reloading nginx the nextcloud-client obtained the token from https correctly.  
I am logged in.

---

<div class="post-metadata">

**Author:** ![banjo42](https://help.nextcloud.com/letter_avatar/banjo42/32/5_5575768a8748004e209b776fc1b2916d.png) [@banjo42](https://help.nextcloud.com/u/banjo42)\
**Post date:** [September 7, 2020, 7:55pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/6 "2020-09-07T19:55:58Z")

</div>

I still have the problem. Now on a Windows 10 Installation from the scratch.  
Waiting for authorization is an endless story.  
Error transferring [http://my.domain.de:12348/login/v2/poll](http://my.domain.de:12348/login/v2/poll)

 ![NextcloudClientHttpStattHttps](https://help.nextcloud.com/uploads/default/original/3X/f/f/fff1aed41dada605286d672573bd516acd44a2d3.png)

I suppose that the setup fails if the http access - which is absolutely not recommended - is not configured and not possible. The setup is stuck then.  
I tested nextcloud-3.0.1-setup and nextcloud-2.6.4-setup and both had the problem.

Finally I could find a workaround.  
I found an older setup of 2018-07-03: Nextcloud-2.3.3.1-setup.exe  
That Nextcloud-2.3.3.1-setup simply requests the URL (with https !!! ) and the credentials and worked perfectly within minutes.

Caution: After i had successfully established the connection and synchronized with my Nextcloud 19.0.2 I had the expectation that I can update to the current version but: The newer setups 2.6.4 and 3.0.1- started and requested the connection data similar to a virgin installation - starting the eternal loop “Waiting for authorization” with Error: “Transferring http:// …” and waiting for armageddon …

In my scenario with a Docker container on a Synology NAS is it so, that the reverse proxy on DSM OS should also provide an automatic redirect of an http request to https. If that worked, the problem possibly would not occur. But again: the missing http redirect is not a problem for me. I simply type https and that’s it.  
An optional http to https redirect should not block a client setup I think . So for me the behavior of the v2 is a bug.

I would like to add that I was able to set the value set “overwrite.cli.url” with occ ,  
me@synodiskstation:~$ sudo docker exec -u www-data -it nextcloud1 /bin/bash  
www-data@nextcloud1:~/html$ ./occ config:system:set “overwrite.cli.url” --value=“https:// [my.domain.de:12348](http://my.domain.de:12348)”  
but unfortunately that did not change the issue and did not correct the wrong server address http in the server settings:

 ![ServerAddressShowsHTTPinsteadOfHTTPS](https://help.nextcloud.com/uploads/default/original/3X/8/9/8905788851b668ea6ef3ac4c1059fda7cfd6b180.png)  
Well - currently I am using the client version 2.3.3 and it is working fine.

---

<div class="post-metadata">

**Author:** ![Snowest](https://help.nextcloud.com/letter_avatar/snowest/32/5_5575768a8748004e209b776fc1b2916d.png) [@Snowest](https://help.nextcloud.com/u/Snowest)\
**Post date:** [September 29, 2020, 10:25am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/7 "2020-09-29T10:25:04Z")

</div>

I do have exactly the same issue.  
I couldn’t donwload version 2.3.3 so I tried with 2.5.0 but no luck.

If anyone could help here, this would be great!

---

<div class="post-metadata">

**Author:** ![banjo42](https://help.nextcloud.com/letter_avatar/banjo42/32/5_5575768a8748004e209b776fc1b2916d.png) [@banjo42](https://help.nextcloud.com/u/banjo42)\
**Post date:** [October 3, 2020, 10:00am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/8 "2020-10-03T10:00:06Z")

</div>

Unfortunately I do not have a solution. I have to add the information that the current client Nextcloud-3.0.2-setup.exe was released 9 days ago and runs into to the same issue "BAd request " [http://mydomain.de:12345/login/v2/](http://mydomain.de:12345/login/v2/)  
So I will try a ‘supposed bug report’ on github as [tflidd] proposes.

---

<div class="post-metadata">

**Author:** ![Snowest](https://help.nextcloud.com/letter_avatar/snowest/32/5_5575768a8748004e209b776fc1b2916d.png) [@Snowest](https://help.nextcloud.com/u/Snowest)\
**Post date:** [October 6, 2020, 6:22pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/9 "2020-10-06T18:22:48Z")

</div>

But are we the only one having this problem? That is strange! Did you made a bugreport? Could you post the link here? Thanks

---

<div class="post-metadata">

**Author:** ![Snowest](https://help.nextcloud.com/letter_avatar/snowest/32/5_5575768a8748004e209b776fc1b2916d.png) [@Snowest](https://help.nextcloud.com/u/Snowest)\
**Post date:** [October 6, 2020, 9:11pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/10 "2020-10-06T21:11:42Z")

</div>

so, finaly I managed to make it work.  
I added ‘overwriteprotocol’ =\> ‘https’, to my config.php, et voilà! now I’m able to connect with my desktop client.

To remember I do run nextcloud into docker on my synology nas.

Thanks

---

<div class="post-metadata">

**Author:** ![banjo42](https://help.nextcloud.com/letter_avatar/banjo42/32/5_5575768a8748004e209b776fc1b2916d.png) [@banjo42](https://help.nextcloud.com/u/banjo42)\
**Post date:** [October 7, 2020, 6:41am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/11 "2020-10-07T06:41:53Z")

</div>

Thank you Snowest for the hint.  
I haven’t created an issue yet. I have the same scenario (nextcloud / docker / synology nas) and will try 'overwriteprotocol’ .

---

<div class="post-metadata">

**Author:** ![Snowest](https://help.nextcloud.com/letter_avatar/snowest/32/5_5575768a8748004e209b776fc1b2916d.png) [@Snowest](https://help.nextcloud.com/u/Snowest)\
**Post date:** [October 7, 2020, 6:55am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/12 "2020-10-07T06:55:08Z")

</div>

Yes,let me know. It would be great if I could help someone. 😉

---

<div class="post-metadata">

**Author:** ![Photubias](https://help.nextcloud.com/letter_avatar/photubias/32/5_5575768a8748004e209b776fc1b2916d.png) [@Photubias](https://help.nextcloud.com/u/Photubias)\
**Post date:** [December 4, 2020, 10:18am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/13 "2020-12-04T10:18:09Z")

</div>

Hi everyone,  
I too had this same problem (proxy between client and server).  
the ‘overwriteprotocol’ =\> ‘https’ together with the correct ‘overwrite.cli.url’ settings in config/config.php fixed everything!

Thank you

---

<div class="post-metadata">

**Author:** ![Maycon\_Marchiori](https://help.nextcloud.com/user_avatar/help.nextcloud.com/maycon_marchiori/32/32703_2.png) [@Maycon\_Marchiori](https://help.nextcloud.com/u/Maycon_Marchiori)\
**Post date:** [January 7, 2021, 5:05pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/14 "2021-01-07T17:05:36Z")

</div>

Hello guys!

I have the same problem, the desktop clients synchronize and arrive at a certain point and give the message ServerReplied: Bad Gateway

**my config.php** -\> [Screenshot by Lightshot](https://prnt.sc/wibe9y)

Centos7  
NC 19  
Nginx

---

<div class="post-metadata">

**Author:** ![getdev](https://help.nextcloud.com/letter_avatar/getdev/32/5_5575768a8748004e209b776fc1b2916d.png) [@getdev](https://help.nextcloud.com/u/getdev)\
**Post date:** [September 14, 2021, 11:58am UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/15 "2021-09-14T11:58:09Z")

</div>

I had the same problem with the message about token and error transferring [https://my.nextcloud.instance/login/v2/poll](https://my.nextcloud.instance/login/v2/poll) bad request  
I’m in a docker container beside traefik https proxy.  
I used @Snowest and @Photubias information and all work fine now.

```auto
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://my.nextcloud.instance',

```

the overwriteprotocol, seems to be enough but the documentation gives information about all :  
[https://docs.nextcloud.com/server/latest/admin\_manual/configuration\_server/config\_sample\_php\_parameters.html?highlight=overwrite%20cli%20url#proxy-configurations](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=overwrite%20cli%20url#proxy-configurations)

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 5:29pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/16 "2024-12-14T17:29:31Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 5:29pm UTC](https://help.nextcloud.com/t/nc-connection-wizard-tries-to-access-token-endpoint-via-http-instead-of-https/79111/17 "2024-12-14T17:29:33Z")

</div>


