You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now if we do a GET request to https://127.0.0.1:3010/v1/list-methods with the certificates generated (by cln-grpc):
$ curl --cacert /tmp/l1-regtest/regtest/ca.pem \
--request GET \
--url https://127.0.0.1:3010/v1/list-methods
we get the following error:
curl: (60) SSL: no alternative certificate subject name matches target host name '127.0.0.1'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
But if we use localhost instead of 127.0.0.1 in the url like this
$ curl --cacert /tmp/l1-regtest/regtest/ca.pem \
--request GET \
--url https://localhost:3010/v1/list-methods
Now we encounter PR #6755. Specifically, before disabling itself at startup, cln-grpc generates the mTLS certificates and consequently clnrest uses them and we encounter the same error as above:
Running that request
$ curl --cacert /tmp/l1-regtest/regtest/ca.pem \
--request GET \
--url https://127.0.0.1:3010/v1/list-methods
gives us that error:
curl: (60) SSL: no alternative certificate subject name matches target host name '127.0.0.1'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
And we have no problem if we use localhost instead of 127.0.0.1.
For the exact same reason (dependency on cln-grpc certificates) if we restart the node with rest-host option being 127.0.0.2 like this
$ curl --cacert /tmp/l1-regtest/regtest/ca.pem \
--request GET \
--url https://127.0.0.2:3010/v1/list-methods
we get a similar error:
curl: (60) SSL: no alternative certificate subject name matches target host name '127.0.0.2'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Now if we explicitly disable the plugin cln-grpc we can't do a curl request with the self-signed certificates because ca.pem file is not generated with CLN v23.08.1 as we can see below:
$ curl --cacert /tmp/l1-regtest/regtest/ca.pem \
--request GET \
--url https://127.0.0.2:3010/v1/list-methods
we get the following error:
curl: (60) SSL: no alternative certificate subject name matches target host name '127.0.0.2'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Fix
If this issue is considered to be a bug, (part of) #6749 fixes it.
The text was updated successfully, but these errors were encountered:
clnrest self-signed certificates error with
curl
Let's use
contrib/startup_regtest.sh
to show what is the problem.With CLN v23.08.1
We source it, start 2 nodes on regtest and we check that we are running CLN v23.08.1:
Now we stop
l1
node by running:Then we restart
lightningd
with bothclnrest
plugin andcln-grpc
plugin by running:Now if we do a GET request to
https://127.0.0.1:3010/v1/list-methods
with the certificates generated (bycln-grpc
):we get the following error:
But if we use
localhost
instead of127.0.0.1
in the url like thisthis works and we get
Now let's stop the node again and remove the certificates generated by
cln-grpc
:We restart the node with no port specified for
cln-grpc
Now we encounter PR #6755. Specifically, before disabling itself at startup,
cln-grpc
generates the mTLS certificates and consequentlyclnrest
uses them and we encounter the same error as above:Running that request
gives us that error:
And we have no problem if we use
localhost
instead of127.0.0.1
.For the exact same reason (dependency on
cln-grpc
certificates) if we restart the node withrest-host
option being127.0.0.2
like thisand we issue the following request
we get a similar error:
Now if we explicitly disable the plugin
cln-grpc
we can't do acurl
request with the self-signed certificates becauseca.pem
file is not generated with CLN v23.08.1 as we can see below:With CLN on master - v23.08.1-205-g1a46b37 - (after the commit that adds complete clnrest generation of the certificates)
gives us:
If we use the defaults (meaning
127.0.0.1
for the host) andcln-grpc
explicitly disabled we can do GET request to both (usingca.pem
file)https://127.0.0.1:3010/v1/list-methods
andhttps://localhost:3010/v1/list-methods
.But if
cln-grpc
is not explicitly disabled a GET request tohttps://127.0.0.1:3010/v1/list-methods
(usingca.pem
file) fails as above.Now if we start
lightningd
with the optionrest-host
set to127.0.0.2
like thisand we issue the following request
we get the following error:
Fix
If this issue is considered to be a bug, (part of) #6749 fixes it.
The text was updated successfully, but these errors were encountered: