KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Building REST API KDB – Issues setting up SSL-TLS

  • Building REST API KDB – Issues setting up SSL-TLS

    Posted by Laura on August 31, 2021 at 12:00 am

    Hi Community,

    I am trying to create a REST API that would have 2 method(get and post), and It would  be initially an empty table   tab:([] a:`$(); b:”i”$()) that would be filled out eventually. So I would be using .Q.hg(get) and .Q.hp(post) for it, my endpoint should be looking like it “http://localhost:5000/upsert?a=Google&b=100so based on what I’ve read I need to open a server instance with this command “$ q -u 1 -E 1 -p 5000” but I am getting this error “‘failed to load TLS certificates”. I followed guidelines for set up this in “https://code.kx.com/q/kb/ssl/ but I didn’t work. Any help about setting up TLS in windows or linux, or any guidance on the rest api would be appreciated.

    Laura replied 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • leahs

    Member
    September 3, 2021 at 12:00 am

    Hello racuna00,

    Can you provide a screenshot of your work or a transcript of your error, please? This will help us identify the issue.

    For example, perhaps a particular step in the guidelines was an issue or missed and we can then help you resolve this.

    Error messages indicating that there’s a problem loading openssl would be returned if setting up the DLL or .so files were missed. If the TLS Client Mode configuration was missed, then you would get an error when trying requests.

    Therefore, if you could provide more detail for us preferably in the form of screenshots or transcripts, we can help you rectify this more efficiently.

    We look forward to hearing from you. Thank you again for your contribution to our KX Community.

    Kind regards,

    Leah

  • Laura

    Administrator
    September 3, 2021 at 12:00 am

    Hi Leah,

    Thanks for your kindly reply. So, I’m trying to do this in a window environment btw, after making sure that my openssl files are in Path. Tried to run  q -u 1 -E 1 -p 5000 but it didn’t work.

     

    For windows, is something else missing?

    Thanks,

    Richard

  • leahs

    Member
    September 6, 2021 at 12:00 am

    Hello Richard,

    Thank you for providing us with additional information.

    Yes, the part missing regards setting  KX_SSL_CERT_FILE (or SSL_CERT_FILE) and KX_SSL_KEY_FILE (or SSL_KEY_FILE) environment variables to the certificate chain and private key that you wish to use.

    Instructions relating to creating self-assigned certificates for internal/testing use can be followed here: https://code.kx.com/q/kb/ssl/#certificates

    This will help you resolve your issue.

    Great content for our community! Thank you for your contribution. We look forward to more.

    Kind regards,

    Leah

     

Log in to reply.