Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: set client CA list based on the ca-dir() and ca-file() options #4412

Merged
merged 2 commits into from Apr 4, 2023

Conversation

alltilla
Copy link
Collaborator

@alltilla alltilla commented Apr 3, 2023

Filling the certificate_authorities field of the certificate request, to help clients choose certs to use.

From https://www.ietf.org/rfc/rfc5246.txt 7.4.4:

certificate_authorities
A list of the distinguished names [X501] of acceptable
certificate_authorities, represented in DER-encoded format. These
distinguished names may specify a desired distinguished name for a
root CA or for a subordinate CA; thus, this message can be used to
describe known roots as well as a desired authorization space. If
the certificate_authorities list is empty, then the client MAY
send any certificate of the appropriate ClientCertificateType,
unless there is some external arrangement to the contrary.

Example:

source s_network {
  network(
    port(12345)
    transport(tls)
    tls(
      ca-dir("/etc/ssl/certs/")
      ca-file("/home/alltilla/repos/syslog-ng/build/install/ssl/ca.crt")
      key-file("/home/alltilla/repos/syslog-ng/build/install/ssl/server.key")
      cert-file("/home/alltilla/repos/syslog-ng/build/install/ssl/server.crt")
      peer-verify(required-trusted)
      ssl-options(no_tlsv13)
    )
  );
};

Screenshot from 2023-04-03 18-01-43

Signed-off-by: Attila Szakacs attila.szakacs@axoflow.com

alltilla added a commit to alltilla/syslog-ng that referenced this pull request Apr 3, 2023
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@alltilla
Copy link
Collaborator Author

alltilla commented Apr 3, 2023

I know that this is yet another case, where sometimes the function is a NOOP, but it would be strange to see the preprocessor macros about the SSL functions being further away from the place they are actually called.

lib/transport/tls-context.c Outdated Show resolved Hide resolved
lib/transport/tls-context.c Show resolved Hide resolved
alltilla added a commit to alltilla/syslog-ng that referenced this pull request Apr 4, 2023
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
alltilla added a commit to alltilla/syslog-ng that referenced this pull request Apr 4, 2023
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@alltilla
Copy link
Collaborator Author

alltilla commented Apr 4, 2023

I have observed, that in case of failure the X509_NAMEs were leaking. Added a fix for it.

Filling the certificate_authorities field of the certificate request,
to help clients choose certs to use.

From https://www.ietf.org/rfc/rfc5246.txt 7.4.4:
>   certificate_authorities
>      A list of the distinguished names [X501] of acceptable
>      certificate_authorities, represented in DER-encoded format.  These
>      distinguished names may specify a desired distinguished name for a
>      root CA or for a subordinate CA; thus, this message can be used to
>      describe known roots as well as a desired authorization space.  If
>      the certificate_authorities list is empty, then the client MAY
>      send any certificate of the appropriate ClientCertificateType,
>      unless there is some external arrangement to the contrary.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@MrAnno MrAnno merged commit afca6b0 into syslog-ng:master Apr 4, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants