Skip to content

SSL certificate checking#190

Open
adamdickmeiss wants to merge 7 commits into
masterfrom
ssl-certificate-checking
Open

SSL certificate checking#190
adamdickmeiss wants to merge 7 commits into
masterfrom
ssl-certificate-checking

Conversation

@adamdickmeiss

Copy link
Copy Markdown
Contributor

No description provided.

New flag CS_FLAGS_CHECK_CERT for comstack which controls whether
rcvconnect phase of client should check certificate. Is disabled
by default to main compatibility.

yaz-ztest/GFS allows fullchain and private PEM to specified separately;
a comma separates the two file names.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces optional TLS/SSL certificate verification across YAZ networking utilities by threading a new “check cert” flag from CLI/API layers into the COMSTACK/TLS (GnuTLS) implementation, plus related documentation updates.

Changes:

  • Add -C CLI option for yaz-url and yaz-client to enable TLS certificate verification.
  • Expose yaz_url_set_check_cert and propagate the check-cert intent via a new CS_FLAGS_CHECK_CERT COMSTACK flag.
  • Implement GnuTLS peer certificate verification and allow specifying separate certificate/private-key files via cert,key parsing.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
util/yaz-url.c Adds -C option to enable certificate checking for yaz-url requests.
src/yaz/url.h Declares new yaz_url_set_check_cert API.
src/yaz/comstack.h Introduces CS_FLAGS_CHECK_CERT flag.
src/url.c Stores check-cert setting on yaz_url_t and passes it into cs_create_host2.
src/tcpip.c Adds system trust loading, TLS peer verification, and separate key file handling for servers.
src/comstack.c Removes an extra blank line.
doc/yaz-url-man.xml Documents -C option for yaz-url.
doc/yaz-client-man.xml Documents -C option for yaz-client.
doc/gfs-options.xml Documents comma-separated cert/key behavior for server SSL certificate option.
client/client.c Adds -C option and propagates CS_FLAGS_CHECK_CERT into connection creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/client.c Outdated
Comment thread client/client.c Outdated
Comment thread src/tcpip.c
Comment on lines 789 to 792
tcpip_create_cred(h);
gnutls_certificate_set_x509_system_trust(sp->cred_ptr->xcred);
gnutls_init(&sp->session, GNUTLS_CLIENT);
sp->use_bye = 1; /* only say goodbye in client */
Comment thread src/tcpip.c Outdated
Comment thread util/yaz-url.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comment thread util/yaz-url.c
@@ -18,6 +18,7 @@
static void usage(void)
{
printf("yaz-icu [options] url ..\n");
Comment thread src/tcpip.c
Comment on lines +753 to +754
size_t sz = 80 + strlen(sp->connect_host) + (sp->connect_auth ? strlen(sp->connect_auth) * 2 : 0);
char *connect_buf = (char *)xmalloc(sz);
Comment thread src/tcpip.c
Comment on lines 1431 to 1434
xfree(sp->host_port);
xfree(sp->connect_request_buf);
xfree(sp->connect_host);
xfree(sp->connect_response_buf);
xfree(sp);
Comment thread src/tcpip.c
Comment on lines 795 to 798
tcpip_create_cred(h);
gnutls_certificate_set_x509_system_trust(sp->cred_ptr->xcred);
gnutls_init(&sp->session, GNUTLS_CLIENT);
sp->use_bye = 1; /* only say goodbye in client */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants