Skip to content

Get a certificate chain with crypto.get_certificate module #568

@ivanov17

Description

@ivanov17
SUMMARY

Currently, crypto.get_certificate module only returns a server certificate itself, but it is more useful to return all certificates sent by the server, as does the -showcerts option of openssl s_client command.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

crypto.get_certificate

ADDITIONAL INFORMATION

For example, I would like to get CA certificate from a LDAP server and save it as a file in the client's trust store. If I don't already have the certificate saved on disk or in a variable, I should try to parse the command module output.

I don't think any additional options are needed here, just expanding the output.

Sample output:

ok: [example] => {
    "my_retrieved_cert": {
        "cert": "-----BEGIN CERTIFICATE-----\nxSERVERxCERTIFICATEx==\n-----END CERTIFICATE-----\n",
        "intermediate": "-----BEGIN CERTIFICATE-----\nxINTERMEDIATExCERTIFICATEx==\n-----END CERTIFICATE-----\n",
        "root": "-----BEGIN CERTIFICATE-----\nxROOTxCERTIFICATEx==\n-----END CERTIFICATE-----\n",
        "changed": false,
        "expired": false,
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions