inlets/inletsctl

inletsctl create not handling --tcp properly

zechen0 opened this issue · 1 comments

The inlets client throws error when provisioning an inlets server in Azure, because the --tcp is not being handled correctly as the previous --pro by inletsctl create. See the related piece of code: https://github.com/inlets/inletsctl/blob/master/cmd/create.go#L195-L197

Error: unable to download CA from remote inlets server for auto-tls: Get "https://40.76.8.88:8123/.well-known/ca.crt": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

inletsctl create

➜  inletsctl create --provider=azure --subscription-id=ffffffff-ffff-ffff-ffff-fffffffffff \
    --region=eastus --access-token-file=./client_credentials.json \
    --tcp
...
...
[11/500] Host: inlets-zen-wilson6|deployment-e8ee78a4-eb51-45f2-93af-e5a7b520e67a, status: Running
[12/500] Host: inlets-zen-wilson6|deployment-e8ee78a4-eb51-45f2-93af-e5a7b520e67a, status: active
inlets PRO (0.8.1) exit-server summary:
  IP: 40.76.8.88
  Auth-token: tvsLYh0ZwxaO9xri18QlUBGmIgbUw2U3YrUDD30oSl5FZXJDq5BXPukyWDIsEeCU

inlets inlets-pro client

➜  inlets inlets-pro client --url "wss://40.76.8.88:8123/connect" \
  --token "tvsLYh0ZwxaO9xri18QlUBGmIgbUw2U3YrUDD30oSl5FZXJDq5BXPukyWDIsEeCU" \
  --license-file "$LICENSE" \
  --upstream $UPSTREAM \
  --ports $PORTS

2021/02/17 17:33:42 Starting TCP client. Version 0.8.0-dirty - 7d2137f283e67490d64ea68903f7d49b9c9463c3
2021/02/17 17:33:42 Licensed to: *******, expires: ******
2021/02/17 17:33:42 Upstream server: 192.168.101.100, for ports: 9090
Error: unable to download CA from remote inlets server for auto-tls: Get "https://40.76.8.88:8123/.well-known/ca.crt": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Expected Behaviour

inlets client should connect to server successfully.

Current Behaviour

Throw error:

Error: unable to download CA from remote inlets server for auto-tls: Get "https://40.76.8.88:8123/.well-known/ca.crt": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Possible Solution

This code should be updated: https://github.com/inlets/inletsctl/blob/master/cmd/create.go#L195-L197

Steps to Reproduce (for bugs)

1.inletsctl create --provider=azure --subscription-id=ffffffff-ffff-ffff-ffff-fffffffffff \ --region=eastus --access-token-file=./client_credentials.json \ --tcp
2. inlets inlets-pro client --url "wss://40.76.8.88:8123/connect" \ --token "tvsLYh0ZwxaO9xri18QlUBGmIgbUw2U3YrUDD30oSl5FZXJDq5BXPukyWDIsEeCU" \ --license-file "$LICENSE" \ --upstream $UPSTREAM \ --ports $PORTS

Context

Your Environment

  • inletsctl master branch

  • macOS

Thank you for raising this issue.

Would you be open to helping with a PR to resolve this?

The --pro/--tcp flags are meant to indicate that all ports need to be opened.

A future --http mode will be added for the new features explained here where ports 80, 443 and 8123 will be needed.