Fix typo in issuer field when exporting SSL certificate to JSON

This commit is contained in:
Jean-Christophe Amiel 2024-06-04 17:23:44 +02:00
parent 4ff24034aa
commit e484b1746d
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
7 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl ssl/cacert.hurl --cacert ssl/ca/cert.pem --ssl-no-revoke --verbose
hurl --cacert ssl/ca/cert.pem --ssl-no-revoke ssl/cacert.hurl

View File

@ -1,3 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl ssl/cacert.hurl --cacert ssl/ca/cert.pem --verbose
hurl --cacert ssl/ca/cert.pem ssl/cacert.hurl

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":5,"success":true},{"line":5,"success":true},{"line":6,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8002"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"https://localhost:8002/hello"},"response":{"certificate":{"expire_date":"2025-03-15 10:48:00 UTC","issuer":"C~=~US, ST~=~Denial, L~=~Springfield, O~=~Dis, CN~=~myCA","serial_number":"3e:23:bb:87:21:f8:10:85:36:c2:72:c9:64:34:d6:15:d1:8c:69:15","start_date":"2022-12-11 10:48:00 UTC","subject":"C~=~US, ST~=~Denial, L~=~Springfield, O~=~Dis, CN~=~localhost"},"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":3,"time":~~~}],"filename":"ssl/cacert.hurl","success":true,"time":~~~}

View File

@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --cacert ssl/ca/cert.pem --ssl-no-revoke --json ssl/cacert.hurl

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --cacert ssl/ca/cert.pem --json ssl/cacert.hurl

View File

@ -179,8 +179,7 @@ struct ResponseCookieJson {
#[derive(Serialize)]
struct CertificateJson {
subject: String,
// FIXME: should be issuer
issue: String,
issuer: String,
start_date: String,
expire_date: String,
serial_number: String,
@ -407,7 +406,7 @@ impl CertificateJson {
fn from_certificate(c: &Certificate) -> Self {
CertificateJson {
subject: c.subject.clone(),
issue: c.issuer.to_string(),
issuer: c.issuer.to_string(),
start_date: c.start_date.to_string(),
expire_date: c.expire_date.to_string(),
serial_number: c.serial_number.to_string(),