in reply to cpan 5.24.3 The interface now has an additional optional argument

What module are you talking about?

From the error message, it seems that the module does not like being called with the deprecated interface that the module itself documents. This seems to be triggered by the Certificatefailed2 part of the code, which is triggered by this check:

pSelf->credStruct.lpszCertBinary

This likely means that whatever is stored in pSelf resp. pSelf->credStruct is empty (well, contains a null pointer). The output of the error message via HandleError feels somewhat misleading, but as I don't know the module and API that you are trying to access that is hard to judge.