Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Unable to connect to an HTTPS endpoint #218

Closed
younes-io opened this issue Apr 26, 2021 · 5 comments
Closed

Unable to connect to an HTTPS endpoint #218

younes-io opened this issue Apr 26, 2021 · 5 comments

Comments

@younes-io
Copy link

Describe the Bug

I have written and run this snippet as Zeebe Modeler uses zeebe-node under the hood:

const zbc = new ZBClient('0.0.0.0:50051', {
	oAuth: {
	  url: 'http://127.0.0.1:4000/token',
	  audience: '***********************************',
	  clientId: '***********************************',
	  clientSecret: '****************************************',
	  cacheOnDisk: true,
	},
	useTLS: true,
});

Here are the logs:

10:52:30.488 | zeebe | INFO: [topology]: 14 UNAVAILABLE: failed to connect to all addresses
E0423 10:52:31.487000000 12952 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
10:52:31.503 | zeebe | INFO: [topology]: Attempt 2 (max: -1).
10:52:31.505 | zeebe | INFO: [topology]: 14 UNAVAILABLE: failed to connect to all addresses
10:52:32.505 | zeebe | INFO: [topology]: Attempt 3 (max: -1).
10:52:32.507 | zeebe | INFO: [topology]: 14 UNAVAILABLE: failed to connect to all addresses
E0423 10:52:33.103000000 12952 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.

However, when I do useTLS: false, it does work ! I have another endpoint in HTTPS, and it only works when useTLS is set to false, otherwise, I get the error above!

Steps to Reproduce

  1. Open Zeebe Modeler, and pick OAuth
  2. Enter your OAuth credentials
  3. Check Zeebe Modeler logs:
    • Windows: C:\Users\yourUser\AppData\Roaming\zeebe-modeler\Zeebe Modeler\logs\log.log
    • MacOS: ~/Library/Logs/Zeebe Modeler/log.log

Expected Behavior

The same behavior as when the authentication method is set to None.

Environment

  • OS: Windows 10 10.0.1904
  • Zeebe Modeler Version: 0.12
  • Node: 12.18.3
  • npm: 6.14.9
  • Chrome: 90.0.4430.85
@jwulf
Copy link
Member

jwulf commented Apr 27, 2021

Thanks for reporting this @younes-io.

What version of the zeebe-node library is in the package.json of your project?

@younes-io
Copy link
Author

younes-io commented Apr 27, 2021

Hello @jwulf ,

In the package.json, I have this "zeebe-node": "^0.23.2"

@barmac
Copy link
Contributor

barmac commented Apr 27, 2021

We've already discussed the issue of fetching token via an insecure, http connection: https://forum.camunda.io/t/an-authentication-issue-in-zeebe-modeler-oauth/2164/6?u=barmac

However, when I do useTLS: false, it does work ! I have another endpoint in HTTPS, and it only works when useTLS is set to false, otherwise, I get the error above!

This might be related to grpc/grpc#9538.

@jwulf
Copy link
Member

jwulf commented May 4, 2021

const zbc = new ZBClient('0.0.0.0:50051', {
oAuth: {
url: 'http://127.0.0.1:4000/token',
audience: '',
clientId: '
',
clientSecret: '****************************************',
cacheOnDisk: true,
},
useTLS: true,
});

I would expect this one to fail, since it is using http. Does this server have TLS enabled?

If it does not, then useTLS: false is the correct setting.

For your endpoint that uses HTTPS (TLS-enabled), you say that it works when you set useTLS: false and fails when you set useTLS: true - is that correct?

@younes-io
Copy link
Author

@jwulf I think this can be closed

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

No branches or pull requests

3 participants