NetTalk Central

Author Topic: Deployment Issue? NetMakeHMAC returns empty string  (Read 1214 times)

ProperGary

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Deployment Issue? NetMakeHMAC returns empty string
« on: September 05, 2022, 07:37:12 AM »
I have a NetTalk API Server, it works on my Windows 10 dev machine and I deployed it to a test VM (Windows 10) and that also worked.

The UAT server is an Azure Windows 2019 Server, and I have what I assume is a deployment issue as I can't get my call to NetMakeHMAC to return a result.

My code is:
Code: [Select]
str.SetValue(CLIP(self.TokenHeader) & '.' & CLIP(self.TokenPayload))
str.SetValue(NetMakeHMAC(str.GetValuePtr(),str.Length(),self.APIClientSecret,net:CALG_SHA_256))    ! <-- This returns empty string in UAT machine
str.Base64Encode(st:NoWrap+st:URLSafe+st:NoPadding)
self.TokenSignature=str.GetValue()

I've checked that all my properties have correct values and I've tested all the values being passed to NetMakeHMAC.
I've also checked that CLANET.DLL, CLARUN.DLL, CLADOS.DLL All match my dev machine and OpenSSL.exe, Msvcr120.dll, Ssleay32.dll, Libssl32.dll and Libeay32.dll are in the EXE folder

I've also used an installer to install OpenSSL (recommendation found elsewhere) and running OpenSSL.exe does not display any errors.

But no matter what I do, NetMakeHMAC returns an empty string on the UAT machine but works on my dev.

Any suggestions? ideas? has anyone seen similar issue?

Gary.


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11175
    • View Profile
Re: Deployment Issue? NetMakeHMAC returns empty string
« Reply #1 on: September 05, 2022, 10:07:40 PM »
The first test is to run openssl.exe in the app folder.
This will (almost certainly) tell you that you're missing something.

You've cunningly omitted to mention which build of NetTalk you are using, so I assume it's NetTalk 12.

My guess is that you haven't installed the VC runtime. See
https://www.capesoft.com/docs/NetTalk12/NetTalk.htm#DeployingAtlsClientOrServer

Cheers
Bruce

ProperGary

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Re: Deployment Issue? NetMakeHMAC returns empty string
« Reply #2 on: September 06, 2022, 12:34:25 AM »
>> You've cunningly omitted to mention which build of NetTalk you are using, so I assume it's NetTalk 12.
Can't make it too easy for you Bruce :)   NetTalk 12.41 to be precise

>>My guess is that you haven't installed the VC runtime.
OK, so I had and I hadn't - I installed the 64 bit, coz it's a 64 bit OS - forgetting that Clarion is 32Bit (forgive me I'm new-ish) and so I needed to install the 32bit version.

Installed 32bit - now all working :)

Thanks