Mtls-plugin testing with pongo - help needed

Hello all,
I have written a mtls-plugin that I’d like to test with pongo.
I have 2 issues.
Considering I have a project dir in which my code but also my testfiles reside and a pongo dir where pongo.sh resides.

  1. I am failing to mount the certificate files through config in my project dir. At the moment I was mounting them from the pongo dir and by specifying them in the kong.yml which I don’t want to do as I don’t want to alter the pongo dir at all. So I would like to know how to mount these files from my ‘plugin’ project dir.
  2. In the testcode I have been trying to provide key and cert files by using proxy_ssl_client, proxy_client, … Then when going through the helpers.lua file, which seems to be the right way to go is calling the connect function first and then using proxy_ssl_client? I have tried quite some things already but I always face some kind of issue, mostly the same, stating “client cert not provided”.

Has anyone experience with this? I have gone through the plugin tests in this repo as well but couldn’t find a usefil example in here.

All help is appreciated.
Thanks a lot!

Greetings,

Hamid K.

@hamidk Does this step-by-step guide assist you in your project?

Thank you Rick, the plugin is developed and works. What I would like to accomplish is to test it in a ci cd pipeline using pongo. And trying to achieve this I encountered 2 issues.

  • I am struggling mounting the certificates through config. There I am looking for a guideline on how to mount files on the pongo test container.
  • also struggling calling the mtls-auth enabled route and providing the client cert. None of the helper functions provided by pongo seem to be able to do this. I think from what I have read I need to use the ngx.ssl and ngx.socket libs to achieve this and I am kind of looking around whether anyone also has already done this.

Greetings