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

Support SSL_CTX_use_certificate_chain_file and SSL_CTX_use_private_key_file #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jul 24, 2021

  1. This commit adds two new methods to openssl.ssl.ctx objects.

    - `ctx:setCertificteFromFile` calls `SSL_CTX_use_certificate_chain_file`
    to add a certificate chain from a pem encoded file specified by the string argument path.
    
    - `ctx:setPrivateKeyFromFile` calls `SSL_CTX_use_private_key_file`
    to add a private key from a PEM or ASN1 encoded file using the string argument path
    and filetype integer flag argument. The filetype is optional and will default to PEM if not
    specified.
    
    - `openssl.filetypes` is a new table in the openssl module which contains the
    two filetypes used by `setPrivateKeyFromFile`. The `.PEM` field is the value of `SSL_FILETYPE_PEM` and
    the `.ASN1` field is the value of `SSL_FILETYPE_ASN1`.
    Mehgugs committed Jul 24, 2021
    Configuration menu
    Copy the full SHA
    1d7b030 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2021

  1. Add the corresponding ssl object methods and format code.

    - Adds `ssl:setCertificateChainFromFile` and `ssl:setPrivateKeyFromFile`
      These both behave the same way as their context counterparts.
    
    - Attempt to improve formatting:
      - Added double newlines between the new code sections.
      - Tried to space out the reg declarations following the style of the code.
      - Added function end comments.
      - Renamed the c functions to match their lua registry name.
    Mehgugs committed Aug 1, 2021
    Configuration menu
    Copy the full SHA
    124d32b View commit details
    Browse the repository at this point in the history