summaryrefslogtreecommitdiff
path: root/src/gmrequest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r--src/gmrequest.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c
index 672614a2..8ae8f736 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -149,7 +149,11 @@ struct Impl_GmRequest {
149iDefineObjectConstructionArgs(GmRequest, (iGmCerts *certs), certs) 149iDefineObjectConstructionArgs(GmRequest, (iGmCerts *certs), certs)
150iDefineAudienceGetter(GmRequest, updated) 150iDefineAudienceGetter(GmRequest, updated)
151iDefineAudienceGetter(GmRequest, finished) 151iDefineAudienceGetter(GmRequest, finished)
152 152
153static uint16_t port_GmRequest_(iGmRequest *d) {
154 return urlPort_String(&d->url);
155}
156
153static void checkServerCertificate_GmRequest_(iGmRequest *d) { 157static void checkServerCertificate_GmRequest_(iGmRequest *d) {
154 const iTlsCertificate *cert = d->req ? serverCertificate_TlsRequest(d->req) : NULL; 158 const iTlsCertificate *cert = d->req ? serverCertificate_TlsRequest(d->req) : NULL;
155 iGmResponse *resp = d->resp; 159 iGmResponse *resp = d->resp;
@@ -165,7 +169,7 @@ static void checkServerCertificate_GmRequest_(iGmRequest *d) {
165 if (verifyDomain_GmCerts(cert, domain)) { 169 if (verifyDomain_GmCerts(cert, domain)) {
166 resp->certFlags |= domainVerified_GmCertFlag; 170 resp->certFlags |= domainVerified_GmCertFlag;
167 } 171 }
168 if (checkTrust_GmCerts(d->certs, domain, cert)) { 172 if (checkTrust_GmCerts(d->certs, domain, port_GmRequest_(d), cert)) {
169 resp->certFlags |= trusted_GmCertFlag; 173 resp->certFlags |= trusted_GmCertFlag;
170 } 174 }
171 if (verify_TlsCertificate(cert) == authority_TlsCertificateVerifyStatus) { 175 if (verify_TlsCertificate(cert) == authority_TlsCertificateVerifyStatus) {
@@ -836,7 +840,7 @@ void submit_GmRequest(iGmRequest *d) {
836 iConnect(TlsRequest, d->req, readyRead, d, readIncoming_GmRequest_); 840 iConnect(TlsRequest, d->req, readyRead, d, readIncoming_GmRequest_);
837 iConnect(TlsRequest, d->req, finished, d, requestFinished_GmRequest_); 841 iConnect(TlsRequest, d->req, finished, d, requestFinished_GmRequest_);
838 if (port == 0) { 842 if (port == 0) {
839 port = 1965; /* default Gemini port */ 843 port = GEMINI_DEFAULT_PORT; /* default Gemini port */
840 } 844 }
841 setHost_TlsRequest(d->req, host, port); 845 setHost_TlsRequest(d->req, host, port);
842 setContent_TlsRequest(d->req, 846 setContent_TlsRequest(d->req,