Skip to content

Commit

Permalink
Handle missing serial number more gracefully (#27681)
Browse files Browse the repository at this point in the history
* Handle missing serial number more gracefully

* remove poc code

* changelog
  • Loading branch information
sgmiller authored Jul 3, 2024
1 parent a707810 commit 30f457f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion builtin/logical/pki/path_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ func (b *backend) pathFetchRead(ctx context.Context, req *logical.Request, data
contentType = "application/pem-certificate-chain"
}
default:
serial = data.Get("serial").(string)
if ser, ok := data.GetOk("serial"); ok {
serial = ser.(string)
}
pemType = "CERTIFICATE"
}
if len(serial) == 0 {
Expand Down
3 changes: 3 additions & 0 deletions changelog/27681.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
secrets/pki: fix lack of serial number to a certificate read resulting in a server side error.
```

0 comments on commit 30f457f

Please sign in to comment.