juju bootstrap with ca-cert-path and ca-private-key-path not using assigned cert/key
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
In Progress
|
High
|
Thomas Miller | ||
3.2 |
In Progress
|
High
|
Thomas Miller | ||
3.3 |
In Progress
|
High
|
Thomas Miller |
Bug Description
juju 3.1.6
Focal 20.04.6
Whenrunning a local bootstrap pointing to use a local set of CA certs/keys with a decrypted key, juju doesn't utilize that CA/key to generate a certificate against the pair.
A juju-ca issuer is still utilized.
juju bootstrap debug output:
```
$ juju bootstrap maas maas --bootstrap-series focal --config ca-cert-
02:09:36 INFO juju.cmd supercommand.go:56 running juju [3.1.6 f6a66aa91eec620
02:09:36 DEBUG juju.cmd supercommand.go:57 args: []string{
02:09:36 DEBUG juju.cmd.
02:09:36 DEBUG juju.cmd.
02:09:36 INFO cmd authkeys.go:113 Adding contents of "/home/
02:09:36 DEBUG juju.cmd.
automatically-
02:09:36 DEBUG juju.provider.maas environprovider
02:09:36 WARN juju.environs.
02:09:36 WARN juju.environs.
02:09:36 WARN juju.environs.
02:09:36 WARN juju.environs.
02:09:36 INFO cmd bootstrap.go:939 Creating Juju controller "maas" on maas/default
02:09:36 INFO juju.cmd.
02:09:36 DEBUG juju.environs.
02:09:36 DEBUG juju.environs.
02:09:36 INFO cmd bootstrap.go:406 Loading image metadata
02:09:36 INFO cmd bootstrap.go:479 Looking for packaged Juju agent version 3.1.6 for amd64
02:09:36 INFO juju.environs.
02:09:36 DEBUG juju.environs.tools tools.go:87 finding agent binaries in stream: "released"
02:09:36 DEBUG juju.environs.tools tools.go:89 reading agent binaries with major.minor version 3.1
02:09:36 DEBUG juju.environs.tools tools.go:98 filtering agent binaries by version: 3.1.6
02:09:36 DEBUG juju.environs.tools tools.go:101 filtering agent binaries by os type: ubuntu
02:09:36 DEBUG juju.environs.tools tools.go:104 filtering agent binaries by architecture: amd64
02:09:36 DEBUG juju.environs.tools urls.go:133 trying datasource "keystone catalog"
02:09:36 DEBUG juju.environs.
02:09:36 DEBUG juju.environs.
02:09:38 DEBUG juju.environs.
02:09:38 DEBUG juju.environs.
02:09:38 DEBUG juju.environs.
02:09:38 DEBUG juju.environs.
02:09:38 INFO juju.environs.
02:09:38 INFO cmd bootstrap.go:492 Located Juju agent version 3.1.6-ubuntu-amd64 at https:/
02:09:38 WARN juju.environs.
02:09:38 WARN juju.environs.
02:09:38 WARN juju.environs.
02:09:38 WARN juju.environs.
02:09:38 INFO cmd bootstrap.go:590 Starting new instance for initial controller
02:09:39 INFO cmd bootstrap.go:184 Launching controller instance(s) on maas/default...
02:09:39 DEBUG juju.provider.maas environ.go:685 attempting to acquire node in zone "default"
02:09:39 DEBUG juju.cloudconfi
02:09:39 DEBUG juju.provider.maas environ.go:769 maas user data; 3720 bytes
02:09:43 DEBUG juju.provider.maas environ.go:795 started instance "eghprm"
02:09:43 INFO cmd bootstrap.go:322 - eghprm (arch=amd64 mem=4G cores=2)
02:09:43 INFO juju.environs.
02:09:43 INFO juju.environs.
02:09:43 INFO cmd bootstrap.go:633 Installing Juju agent on bootstrap instance
02:12:20 DEBUG juju.cloudconfi
Waiting for address
02:12:20 DEBUG juju.provider.maas instance.go:88 "juju" has addresses ["local-
Attempting to connect to 192.168.122.13:22
02:12:21 DEBUG juju.provider.
02:12:26 DEBUG juju.provider.
02:12:30 DEBUG juju.provider.maas instance.go:88 "juju" has addresses ["local-
02:12:32 DEBUG juju.provider.
02:12:37 INFO cmd bootstrap.go:436 Connected to 192.168.122.13
02:12:37 INFO juju.cloudconfig userdatacfg_
02:12:37 INFO cmd bootstrap.go:506 Running machine configuration script...
02:15:35 INFO cmd bootstrap.go:744 Bootstrap agent now started
02:15:36 DEBUG juju.provider.maas instance.go:88 "juju" has addresses ["local-
02:15:36 INFO juju.juju api.go:354 API endpoints changed from [] to [192.168.
02:15:36 INFO cmd controller.go:88 Contacting Juju controller at 192.168.122.13 to verify accessibility...
02:15:36 INFO juju.juju api.go:86 connecting to API addresses: [192.168.
02:15:38 DEBUG juju.api apiclient.go:1171 successfully dialed "wss://
02:15:38 INFO juju.api apiclient.go:706 connection established to "wss://
02:15:38 DEBUG juju.api monitor.go:35 RPC connection died
02:15:38 INFO cmd controller.go:108
Bootstrap complete, controller "maas" is now available
Controller machines are in the "controller" model
02:15:38 INFO cmd bootstrap.go:658
Now you can run
juju add-model <model-name>
to create a new model to deploy workloads.
02:15:38 INFO cmd supercommand.go:535 command finished
```
openssl output from newly generated cert:
```$ openssl s_client -showcerts -connect 192.168.
CONNECTED(00000003)
Can't use SSL_get_servername
depth=1 O = Juju, CN = juju-ca
verify error:num=19:self signed certificate in certificate chain
verify return:1
depth=1 O = Juju, CN = juju-ca
verify return:1
depth=0 O = Juju, CN = Juju server certificate - controllerip, serialNumber = 3d3bee3c-
verify return:1
---
Certificate chain
0 s:O = Juju, CN = Juju server certificate - controllerip, serialNumber = 3d3bee3c-
i:O = Juju, CN = juju-ca
-----BEGIN CERTIFICATE-----
MIIEUzCCArugAwI
CwUAMCExDTALBgN
MDIxMDM2WhcNMzM
EyZKdWp1IHNlcnZ
BRMkM2QzYmVlM2M
hkiG9w0BAQEFAAO
pabCiBuvlCO77S0
s8vwAXcj71yeTHC
iIB+/giCt69am0H
fG5KGhfGamFbKKJ
if0Q+PEW0x9VRTi
+pcIOndEmv41X5T
uKrASaq9iw1/
WG0nkKKFX16FZ0d
r6Ab45m7IzD/
BQADggGBAJZrTMk
wkvsotGYKAZhUNk
7NRngcqMoJWKP8P
RsQrVwxelrFksne
t2eWSHb3Bhodlgd
pY4SA8f7TaxzlVt
Y1swDCpdriHLTDk
/Xbdmt16LRbiF9g
R3RVYPFrvA==
-----END CERTIFICATE-----
1 s:O = Juju, CN = juju-ca
i:O = Juju, CN = juju-ca
-----BEGIN CERTIFICATE-----
MIIEEjCCAnqgAwI
BQAwITENMAsGA1U
MjA0MzZaFw0zMzE
B2p1anUtY2EwggG
L4M2Inv4liaHN14
SNZW1KqJKCP+
efkFV4pfUQA9xtF
uq1k4Ibfr3lIiwF
FmLduX2+
Svv4wI41ADE8FQq
6njiDMxTQBPvyF0
dMplx3NZnLBE1Qg
MEAwDgYDVR0PAQH
r6Ab45m7IzD/
VnCG66nc9gZigzz
7hAXglCFjJWkVHL
SHlw9bk/
2z7nOMWmKV0TyzS
qElTpdrK37GENGo
AVqIqVylxrjLc98
QrN5FS17RMDQ1Vs
quQKdcNyEY5rxlc
-----END CERTIFICATE-----
---
Server certificate
subject=O = Juju, CN = Juju server certificate - controllerip, serialNumber = 3d3bee3c-
issuer=O = Juju, CN = juju-ca
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2863 bytes and written 370 bytes
Verification error: self signed certificate in certificate chain
---
New, TLSv1.3, Cipher is TLS_AES_
Server public key is 3072 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 19 (self signed certificate in certificate chain)
---
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_
Session-ID: B61B5D9C853774D
Session-ID-ctx:
Resumption PSK: 91CB1A72A959F9F
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 604800 (seconds)
TLS session ticket:
0000 - 8a 5c 38 4a 68 0a c2 ac-47 03 96 3f c5 73 1b 34 .\8Jh...G..?.s.4
0010 - 69 3f 35 36 56 53 40 e1-41 a8 d8 b2 42 5a 06 46 i?56VS@.A...BZ.F
0020 - 74 bf 9b 2e cf 26 3a 7a-63 7c 6a f2 d0 94 b3 90 t....&:zc|j.....
0030 - cb c5 55 de 01 86 44 77-0b e4 fd 24 cc cc 17 c7 ..U...Dw...$....
0040 - 64 68 2b fd d3 2d b3 02-ec 28 59 65 48 9f ce 4d dh+..-...(YeH..M
0050 - c2 2d 9c 03 aa 86 5a ad-34 e0 ee 28 50 2f 0f 87 .-....Z.4..(P/..
0060 - 48 1a a5 8f 56 db e7 1a-17 1f 23 f5 21 04 38 d3 H...V.....#.!.8.
0070 - 15 .
Start Time: 1696990592
Timeout : 7200 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
```
Possibly unrelated, but when using just ca-cert and ca-private-key without the -path reads the files but fails to bootstrap:
``` key="$( cat ca-private- key.pem) " --debug f5ac04a19d8c06b ef03ae6228 gc go1.20.8] "/snap/ juju/24626/ bin/juju" , "bootstrap", "maas", "maas", "--bootstrap- series" , "focal", "--config", "ca-cert=-----BEGIN CERTIFICATE- ----\nMIIDVzCCA j+gAwIBAgIUUKjZ YxXOfxfk1pPA4Lu 2PmecXK8wDQYJKo ZIhvcNAQEL\ nBQAwOzELMAkGA1 UEBhMCVVMxCzAJB gNVBAgMAkZMMQ0w CwYDVQQKDARVU0F GMRAw\nDgYDVQQD DAdhbXBob3JhMB4 XDTIzMDkyNTE4NT UxMFoXDTMzMDkyM jE4NTUxMFow\ nOzELMAkGA1UEBh MCVVMxCzAJBgNVB AgMAkZMMQ0wCwYD VQQKDARVU0FGMRA wDgYD\nVQQDDAdh bXBob3JhMIIBIjA NBgkqhkiG9w0BAQ EFAAOCAQ8AMIIBC gKCAQEArHZt\ n2UID0WzK32qyJH 7KFtRk7VLQ/ FZSOqwQQmjPCk9f fsmVciMqsD02gAl uCQyUwOBS\ ndPCv52kz95rQfC 2LSh1OQYG2GraiF /QFnAEbYF+ 77W4xAOmgYe77ol OxEyWtRD6+ \nK8uIov06EROzm nnELdHEua6eCZRI C/W8OIpj7rzThMs 4G8vpQam82Xpk1g JMrJws\ nFCDUEF8+ 2intZ6zqL/ q5Q6SZ+ h0nZSnhmlCw/ UTCH12H1ZjI9+ W6ZRQ1ZnOHxkvi\ nFBjg/SMGnfmId9 jrXhEl/ FvuY/nhcfC40vW7 9Vp3ZLdMRyKz4vf lDUE4MJm/ DIJy\nZyzzv7fkJ +uCgYcB/ wIDAQABo1MwUTAd BgNVHQ4EFgQU7OI M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Y9W/ BA9w3ioX2Z7+ h3z2WrbAyq+ FQwApuauTj\ n/C1wV7wShWZDHl VJXuLUm0uZhckkS wXPc5WVGMeC4vNH xqd5JBfm5vhzpJ7 OL/Vc\n1tgvUGYv 3wKE38Cf/ vtFr4Z5/ PgJnpq6QAG1rx8k jvrvnVwB+ KTJMUFaUeKqR7+ I\nyZkUn900Y62D 9zTqTHb9NJFw9mC Hi47u13uZU4W2y1 KOKxPThx0+ NzKFCaD1I34w\ ntPqf2a+ mQauaq32LIpV/ zoBaezSeej4YkRn 8pCrW5QECgYEA3o TFp31bRLws2eJO\ nNI6sMH7OFGbuXE 9yIsxSZlVO/ XpIYazN+ LGYZSOsPGPwApjo sQQeoamqTfUz/ dqV\n8nSj57ZzOO kJsJZSrB5S+ /IYq8Ngki5NFYWd V9FDEEHOu76VqHC LebC2Jm3K+ ZzA\nJeUbVNFwbe OI6Dq5LTZC+ nYdVwUCgYEAxmmK pubr7TXEox8GXFa e1TrBzdAb/ EhA\nAxfZ6AGsaH Pcrr9FI1iuiCoMN sTn7QMco6bggEwu 36Pw9Qdhz5KdnWW Wfu2PNOut\ nGAh0YMb3ws+ QraQxFwYwQzwzhg f9QKsN7TliKk468 wa8MVvBLd7CQmEA //hVuDkb\ nPCFjhbNbvDMCgY AmyN+mrOvelCoBJ DfbY07R+ Rg0aCh9wH81X4Wx PodRGSJKnBMe\ nmN3mKwyXThgEa+ CLEhvAs9DyW53fT l06cGgtOBjnP38n 31uzkmmGbpEsRxa rBBT9\nfleJefkF eWLuSG7PeCZnZIy rMBHj5hV7xW45H3 RIQxOW3r1uCvorq 7C7fQKBgQDD\ nBw0d35B6O0bM. ..
~$ juju bootstrap maas maas --bootstrap-series focal --config ca-cert="$(cat ./ca-cert.pem)" --config ca-private-
15:42:33 INFO juju.cmd supercommand.go:56 running juju [3.1.6 f6a66aa91eec620
15:42:33 DEBUG juju.cmd supercommand.go:57 args: []string{