mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
default cert fallback without SNI
The protocol specification requires that clients do not use SNI when IP addresses are used instead of domains. closes https://github.com/mbrubeck/agate/pull/433 Co-authored-by: oooo-ps <l.trk@tuta.io>
This commit is contained in:
parent
2d6dac4a2f
commit
d4f7867724
1 changed files with 6 additions and 2 deletions
|
|
@ -222,8 +222,12 @@ impl ResolvesServerCert for CertStore {
|
||||||
.map(|(_, k)| k)
|
.map(|(_, k)| k)
|
||||||
.cloned()
|
.cloned()
|
||||||
} else {
|
} else {
|
||||||
// This kind of resolver requires SNI.
|
// Fallback to default cert. Due to the certificate loading logic,
|
||||||
None
|
// the fallback cert is always the last one, if it is present.
|
||||||
|
match self.certs.last() {
|
||||||
|
Some((domain, key)) if domain.is_empty() => Some(key.clone()),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue