send connection parameters in CHLO

This commit is contained in:
Marten Seemann
2016-12-09 17:42:26 +07:00
parent 1ad3a85f5c
commit f72fbc57a9
9 changed files with 150 additions and 35 deletions

View File

@@ -120,7 +120,8 @@ var _ = Describe("Crypto setup", func() {
stream = &mockStream{}
certManager = &mockCertManager{}
csInt, err := NewCryptoSetupClient("hostname", 0, protocol.Version36, stream)
version := protocol.Version36
csInt, err := NewCryptoSetupClient("hostname", 0, version, stream, NewConnectionParamatersManager(protocol.PerspectiveClient, version))
Expect(err).ToNot(HaveOccurred())
cs = csInt.(*cryptoSetupClient)
cs.certManager = certManager
@@ -420,6 +421,17 @@ var _ = Describe("Crypto setup", func() {
Expect(tags[TagCCS]).To(Equal(certManager.commonCertificateHashes))
})
It("adds the tags returned from the connectionParametersManager to the CHLO", func() {
cpmTags, err := cs.connectionParameters.GetCHLOMap()
Expect(err).ToNot(HaveOccurred())
Expect(cpmTags).ToNot(BeEmpty())
tags, err := cs.getTags()
Expect(err).ToNot(HaveOccurred())
for t := range cpmTags {
Expect(tags).To(HaveKey(t))
}
})
It("doesn't send a CCS if there are no common certificate sets available", func() {
certManager.commonCertificateHashes = nil
tags, err := cs.getTags()