[GH-ISSUE #1151] Hello, how can I set my certificate to Netbird and a custom SSL port? #1976

Closed
opened 2026-08-05 00:44:49 -04:00 by saavagebueno · 28 comments
Owner

Originally created by @Pinkpiglet on GitHub (Sep 16, 2023).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/1151

Hello, how can I set my certificate to Netbird and a custom SSL port?

Originally created by @Pinkpiglet on GitHub (Sep 16, 2023). Original GitHub issue: https://github.com/netbirdio/netbird/issues/1151 Hello, how can I set my certificate to Netbird and a custom SSL port?
Author
Owner

@Pinkpiglet commented on GitHub (Sep 16, 2023):

image
The port has been changed, but there will be a 401 error message

<!-- gh-comment-id:1722346068 --> @Pinkpiglet commented on GitHub (Sep 16, 2023): ![image](https://github.com/netbirdio/netbird/assets/38532706/3f8ed080-4d72-4530-b01e-38fbcc4e7942) The port has been changed, but there will be a 401 error message
Author
Owner

@surik commented on GitHub (Sep 18, 2023):

Hi @Pinkpiglet, could you please take a look at the error logs of the management service via docker-compose logs management? Also, can you share more about your IDP setup?

<!-- gh-comment-id:1723046452 --> @surik commented on GitHub (Sep 18, 2023): Hi @Pinkpiglet, could you please take a look at the error logs of the management service via `docker-compose logs management`? Also, can you share more about your IDP setup?
Author
Owner

@Pinkpiglet commented on GitHub (Sep 18, 2023):

Hello, this is Management.json and related error messages.

{
"Stuns": [
{
"Proto": "udp",
"URI": "stun:netbird.xxxx.com:3478",
"Username": "",
"Password": null
}
],
"TURNConfig": {
"Turns": [
{
"Proto": "udp",
"URI": "turn:netbird.xxxx.com:3478",
"Username": "self",
"Password": "GwbSf9uOYN6OQilqNnXzV8xU2sgjPnyuZq0hut1WRXc"
}
],
"CredentialsTTL": "12h",
"Secret": "secret",
"TimeBasedCredentials": false
},
"Signal": {
"Proto": "http",
"URI": "netbird.xxxx.com:10000",
"Username": "",
"Password": null
},
"Datadir": "",
"HttpConfig": {
"Address": "0.0.0.0:33073",
"AuthIssuer": "https://authentik.xxxx.com:9443/application/o/netbird/",
"AuthAudience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"AuthKeysLocation": "https://authentik.xxxx.com:9443/application/o/netbird/jwks/",
"AuthUserIDClaim": "",
"CertFile":"/etc/letsencrypt/live/netbird.xxxx.com/fullchain.pem",
"CertKey":"/etc/letsencrypt/live/netbird.xxxx.com/privkey.pem",
"OIDCConfigEndpoint":"https://authentik.xxxx.com:9443/application/o/netbird/.well-known/openid-configuration"
},
"IdpManagerConfig": {
"ManagerType": "authentik",
"ClientConfig": {
"Issuer": "https://authentik.xxxx.com:9443/application/o/netbird/",
"TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/",
"ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"ClientSecret": "",
"GrantType": "client_credentials"
},
"ExtraConfig": {
"Password": "QW4TqXjF7JD5VTj1NH0KQzovk1FYBK8U36GscTKCdT7vxuDpGLkjcGi968H4",
"Username": "Netbird"
}
},
"DeviceAuthorizationFlow": {
"Provider": "hosted",
"ProviderConfig": {
"Audience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"Domain": "",
"ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/",
"DeviceAuthEndpoint": "https://authentik.xxxx.com:9443/application/o/device/",
"Scope": "openid",
"UseIDToken": false
}
},
"PKCEAuthorizationFlow": {
"ProviderConfig": {
"Audience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ",
"ClientSecret": "",
"AuthorizationEndpoint": "https://authentik.xxxx.com:9443/application/o/authorize/",
"TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/",
"Scope": "openid profile email offline_access api",
"RedirectURLs": ["http://localhost:53000"],
"UseIDToken": false
}
}
}

image
@surik

<!-- gh-comment-id:1724121839 --> @Pinkpiglet commented on GitHub (Sep 18, 2023): Hello, this is Management.json and related error messages. { "Stuns": [ { "Proto": "udp", "URI": "stun:netbird.xxxx.com:3478", "Username": "", "Password": null } ], "TURNConfig": { "Turns": [ { "Proto": "udp", "URI": "turn:netbird.xxxx.com:3478", "Username": "self", "Password": "GwbSf9uOYN6OQilqNnXzV8xU2sgjPnyuZq0hut1WRXc" } ], "CredentialsTTL": "12h", "Secret": "secret", "TimeBasedCredentials": false }, "Signal": { "Proto": "http", "URI": "netbird.xxxx.com:10000", "Username": "", "Password": null }, "Datadir": "", "HttpConfig": { "Address": "0.0.0.0:33073", "AuthIssuer": "https://authentik.xxxx.com:9443/application/o/netbird/", "AuthAudience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "AuthKeysLocation": "https://authentik.xxxx.com:9443/application/o/netbird/jwks/", "AuthUserIDClaim": "", "CertFile":"/etc/letsencrypt/live/netbird.xxxx.com/fullchain.pem", "CertKey":"/etc/letsencrypt/live/netbird.xxxx.com/privkey.pem", "OIDCConfigEndpoint":"https://authentik.xxxx.com:9443/application/o/netbird/.well-known/openid-configuration" }, "IdpManagerConfig": { "ManagerType": "authentik", "ClientConfig": { "Issuer": "https://authentik.xxxx.com:9443/application/o/netbird/", "TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/", "ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "ClientSecret": "", "GrantType": "client_credentials" }, "ExtraConfig": { "Password": "QW4TqXjF7JD5VTj1NH0KQzovk1FYBK8U36GscTKCdT7vxuDpGLkjcGi968H4", "Username": "Netbird" } }, "DeviceAuthorizationFlow": { "Provider": "hosted", "ProviderConfig": { "Audience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "Domain": "", "ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/", "DeviceAuthEndpoint": "https://authentik.xxxx.com:9443/application/o/device/", "Scope": "openid", "UseIDToken": false } }, "PKCEAuthorizationFlow": { "ProviderConfig": { "Audience": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "ClientID": "rEy9QLhxhRQyvqVyBUkVJdqUE22i0PfYVMa2G5sZ", "ClientSecret": "", "AuthorizationEndpoint": "https://authentik.xxxx.com:9443/application/o/authorize/", "TokenEndpoint": "https://authentik.xxxx.com:9443/application/o/token/", "Scope": "openid profile email offline_access api", "RedirectURLs": ["http://localhost:53000"], "UseIDToken": false } } } ![image](https://github.com/netbirdio/netbird/assets/38532706/a1adaf7c-7748-4b27-842f-8f401e1743e4) @surik
Author
Owner

@Pinkpiglet commented on GitHub (Sep 18, 2023):

I guess it should be related to this:

Grant_types_supported:[
Authorization_code ",
Refresh_token,
Implicit,
Client_credentials ",
Password,
Urn: ietf: params: oauth: grant type: device_code
] @surik

<!-- gh-comment-id:1724150761 --> @Pinkpiglet commented on GitHub (Sep 18, 2023): I guess it should be related to this: Grant_types_supported:[ Authorization_code ", Refresh_token, Implicit, **Client_credentials ",** Password, Urn: ietf: params: oauth: grant type: device_code ] @surik
Author
Owner

@Pinkpiglet commented on GitHub (Sep 18, 2023):

image
image
It has been resolved and is indeed related to the authentication jwt encryption certificate.
@surik

<!-- gh-comment-id:1724190987 --> @Pinkpiglet commented on GitHub (Sep 18, 2023): ![image](https://github.com/netbirdio/netbird/assets/38532706/cf5c6880-28b6-4047-97ef-d0105dcf1510) ![image](https://github.com/netbirdio/netbird/assets/38532706/dbb930ec-a3d0-4d5f-b465-526da7150263) It has been resolved and is indeed related to the authentication jwt encryption certificate. @surik
Author
Owner

@Pinkpiglet commented on GitHub (Sep 19, 2023):

@surik Two devices are already online, but they cannot ping each other. Which service's logs do I need to view?

<!-- gh-comment-id:1724825673 --> @Pinkpiglet commented on GitHub (Sep 19, 2023): @surik Two devices are already online, but they cannot ping each other. Which service's logs do I need to view?
Author
Owner

@Pinkpiglet commented on GitHub (Sep 19, 2023):

image

<!-- gh-comment-id:1724828977 --> @Pinkpiglet commented on GitHub (Sep 19, 2023): ![image](https://github.com/netbirdio/netbird/assets/38532706/3ab3d588-5599-4a3a-bea0-6f53aeadb549)
Author
Owner

@surik commented on GitHub (Sep 19, 2023):

@Pinkpiglet thank you for providing extensive information. In this case, I would start with /var/log/netbird/client.log(on Windows whatever you see as default for --log-file in netbird service --help) of the machine that is not able to ping.

<!-- gh-comment-id:1725286607 --> @surik commented on GitHub (Sep 19, 2023): @Pinkpiglet thank you for providing extensive information. In this case, I would start with `/var/log/netbird/client.log`(on Windows whatever you see as default for `--log-file` in `netbird service --help`) of the machine that is not able to ping.
Author
Owner

@Pinkpiglet commented on GitHub (Sep 19, 2023):

@surik
windows11:
image

debian12
image

<!-- gh-comment-id:1725347311 --> @Pinkpiglet commented on GitHub (Sep 19, 2023): @surik windows11: ![image](https://github.com/netbirdio/netbird/assets/38532706/aaf70dd5-9cd5-46aa-b99a-ec7bbd988e14) debian12 ![image](https://github.com/netbirdio/netbird/assets/38532706/57f05bf7-b5e3-49c4-bb3f-1e3ffdf94246)
Author
Owner

@surik commented on GitHub (Sep 19, 2023):

@Pinkpiglet that might be a TURN issue. Can you perform the same test as described in this comment? https://github.com/netbirdio/netbird/issues/798#issuecomment-1502430133

<!-- gh-comment-id:1726392724 --> @surik commented on GitHub (Sep 19, 2023): @Pinkpiglet that might be a TURN issue. Can you perform the same test as described in this comment? https://github.com/netbirdio/netbird/issues/798#issuecomment-1502430133
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@surik
image
Prompted authentication failures

<!-- gh-comment-id:1727868297 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): @surik ![image](https://github.com/netbirdio/netbird/assets/38532706/1ad6e12e-063f-4bb4-b950-df8dd4c0b061) Prompted authentication failures
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

@Pinkpiglet Yes, looks like TURN is not configured properly. Maybe you can try to change the password and restart the TURN service? Please let me know if this works.

<!-- gh-comment-id:1727905282 --> @surik commented on GitHub (Sep 20, 2023): @Pinkpiglet Yes, looks like TURN is not configured properly. Maybe you can try to change the password and restart the TURN service? Please let me know if this works.
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@surik
image
After resetting the port and password, the test was normal, but still unable to ping the other party's device

<!-- gh-comment-id:1727930840 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): @surik ![image](https://github.com/netbirdio/netbird/assets/38532706/7fb468df-805c-4f4c-8ff0-875508f30af1) After resetting the port and password, the test was normal, but still unable to ping the other party's device
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

@Pinkpiglet did you restart the netibird service on the machine? What is the output of the status command now?

<!-- gh-comment-id:1727936846 --> @surik commented on GitHub (Sep 20, 2023): @Pinkpiglet did you restart the netibird service on the machine? What is the output of the status command now?
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@surik image

<!-- gh-comment-id:1727937410 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): @surik ![image](https://github.com/netbirdio/netbird/assets/38532706/0b03e5f7-53a0-470f-b04c-df9ac0938e44)
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@surik The service has been restarted

<!-- gh-comment-id:1727947087 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): @surik The service has been restarted
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

@Pinkpiglet please show the output of the status command I'm assuming that we have TURN properly up and running we can see something new there

<!-- gh-comment-id:1727965651 --> @surik commented on GitHub (Sep 20, 2023): @Pinkpiglet please show the output of the status command I'm assuming that we have TURN properly up and running we can see something new there
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

@Pinkpiglet Also, could you confirm that the TURN credentials are in sync in management.json and turnserver.conf and that both services restarted?

<!-- gh-comment-id:1727984559 --> @surik commented on GitHub (Sep 20, 2023): @Pinkpiglet Also, could you confirm that the TURN credentials are in sync in `management.json` and `turnserver.conf` and that both services restarted?
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@Pinkpiglet Also, could you confirm that the TURN credentials are in sync in management.json and turnserver.conf and that both services restarted?

Yes, all have been restarted.

<!-- gh-comment-id:1728001481 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): > @Pinkpiglet Also, could you confirm that the TURN credentials are in sync in `management.json` and `turnserver.conf` and that both services restarted? Yes, all have been restarted.
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

@Pinkpiglet please show the output of the status command I'm assuming that we have TURN properly up and running we can see something new there

image
image

<!-- gh-comment-id:1728008745 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): > @Pinkpiglet please show the output of the status command I'm assuming that we have TURN properly up and running we can see something new there ![image](https://github.com/netbirdio/netbird/assets/38532706/14d45b2e-988c-4534-91a7-322ae3f2d6d4) ![image](https://github.com/netbirdio/netbird/assets/38532706/fc1bbfbd-e001-4b7b-a12d-ffcddabde323)
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

@Pinkpiglet thank you. I will need more logs to understand how the status of connection from netbird to TURN. On the Linux machines can you do the following:

sudo mkdir -p /etc/sysconfig
echo 'PIONS_LOG_DEBUG=all' | sudo tee -a /etc/sysconfig/netbird
echo 'NB_LOG_LEVEL=debug' | sudo tee -a /etc/sysconfig/netbird
sudo netbird service restart

After at least 1 minute please collect the following files:

/var/log/netbird/client.log
/var/log/netbird/netbird.out
/var/log/netbird/netbird.err

You can share them here or another option is to join our Slack group.

<!-- gh-comment-id:1728055209 --> @surik commented on GitHub (Sep 20, 2023): @Pinkpiglet thank you. I will need more logs to understand how the status of connection from netbird to TURN. On the Linux machines can you do the following: ``` sudo mkdir -p /etc/sysconfig echo 'PIONS_LOG_DEBUG=all' | sudo tee -a /etc/sysconfig/netbird echo 'NB_LOG_LEVEL=debug' | sudo tee -a /etc/sysconfig/netbird sudo netbird service restart ``` After at least 1 minute please collect the following files: ``` /var/log/netbird/client.log /var/log/netbird/netbird.out /var/log/netbird/netbird.err ``` You can share them here or another option is to join our [Slack group](https://join.slack.com/t/netbirdio/shared_invite/zt-vrahf41g-ik1v7fV8du6t0RwxSrJ96A).
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

/var/log/netbird/

netbird.log

client.log

<!-- gh-comment-id:1728142377 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): > /var/log/netbird/ [netbird.log](https://github.com/netbirdio/netbird/files/12675820/netbird.log) [client.log](https://github.com/netbirdio/netbird/files/12675810/client.log)
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host
ice WARNING: 2023/09/21 01:08:25 Failed to build new turn.Client netbird.xxxx.com:3478 lookup netbird.xxxx.com on 114.114.114.114:53: no such host
ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host

The machine you used to test with https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ was able to resolve that domain. Wonder why this is not the case for the instance above.

<!-- gh-comment-id:1728226814 --> @surik commented on GitHub (Sep 20, 2023): ``` ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host ice WARNING: 2023/09/21 01:08:25 Failed to build new turn.Client netbird.xxxx.com:3478 lookup netbird.xxxx.com on 114.114.114.114:53: no such host ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host ``` The machine you used to test with https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ was able to resolve that domain. Wonder why this is not the case for the instance above.
Author
Owner

@Pinkpiglet commented on GitHub (Sep 20, 2023):

ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host
ice WARNING: 2023/09/21 01:08:25 Failed to build new turn.Client netbird.xxxx.com:3478 lookup netbird.xxxx.com on 114.114.114.114:53: no such host
ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host

您用来测试https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ 的机器能够解析该域。想知道为什么上面的例子不是这种情况。

I have used another server and it is already possible, but the Windows client cannot access the network with routing settings, and my phone can access it.
image

<!-- gh-comment-id:1728236328 --> @Pinkpiglet commented on GitHub (Sep 20, 2023): > ``` > ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host > ice WARNING: 2023/09/21 01:08:25 Failed to build new turn.Client netbird.xxxx.com:3478 lookup netbird.xxxx.com on 114.114.114.114:53: no such host > ice WARNING: 2023/09/21 01:08:25 failed to resolve stun host: netbird.xxxx.com:3478: lookup netbird.xxxx.com on 114.114.114.114:53: no such host > ``` > > 您用来测试[https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ 的](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/)机器能够解析该域。想知道为什么上面的例子不是这种情况。 I have used another server and it is already possible, but the Windows client cannot access the network with routing settings, and my phone can access it. ![image](https://github.com/netbirdio/netbird/assets/38532706/9405a946-a5b8-4e94-94a2-d80c154e259a)
Author
Owner

@surik commented on GitHub (Sep 20, 2023):

Unfortunately, only Linux is supported as a routing peers right now.

<!-- gh-comment-id:1728257791 --> @surik commented on GitHub (Sep 20, 2023): Unfortunately, only Linux is supported as a [routing peers](https://docs.netbird.io/how-to/routing-traffic-to-private-networks#routing-peer) right now.
Author
Owner

@Pinkpiglet commented on GitHub (Sep 24, 2023):

不幸的是,目前仅支持 Linux 作为路由对等点。

Approximately when will this support the Windows system

<!-- gh-comment-id:1732529563 --> @Pinkpiglet commented on GitHub (Sep 24, 2023): > 不幸的是,目前仅支持 Linux 作为[路由对等点。](https://docs.netbird.io/how-to/routing-traffic-to-private-networks#routing-peer) Approximately when will this support the Windows system
Author
Owner

@Pinkpiglet commented on GitHub (Sep 24, 2023):

Unfortunately, only Linux is supported as a routing peers right now.

Android client using non 443 port prompts for invalid address

<!-- gh-comment-id:1732541414 --> @Pinkpiglet commented on GitHub (Sep 24, 2023): > Unfortunately, only Linux is supported as a [routing peers](https://docs.netbird.io/how-to/routing-traffic-to-private-networks#routing-peer) right now. Android client using non 443 port prompts for invalid address
Author
Owner

@surik commented on GitHub (Sep 25, 2023):

@Pinkpiglet

Approximately when will this support the Windows system

We don't have an estimation for this unfortunately

Android client using non 443 port prompts for invalid address

Can you elaborate on this? You may have logs to demonstrate the issue.

<!-- gh-comment-id:1733591933 --> @surik commented on GitHub (Sep 25, 2023): @Pinkpiglet > Approximately when will this support the Windows system We don't have an estimation for this unfortunately > Android client using non 443 port prompts for invalid address Can you elaborate on this? You may have logs to demonstrate the issue.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#1976