I setup the activation kit for an ebook I’m managing and it used to work perfectly. After I updated the software, I keep getting an HTTP Error Code 502 whenever I try to activate the ebook.
When I try to make a manual HTTP POST request to the activation server, everything works fine. But the post that the ebook generates returns an 502 error.
Has the activation procedure changed in the last few updates? I remember it working perfectly.
No, activation procedures haven’t changed. But maybe you have a security software (firewall for instance) that modifies the POST request and generate this 502 error?
Apparently the problem is caused when the request has the following header:
Content-Type: application/x-www-form-urlencoded; charset=65001 (UTF-8)
It works when I omit the “(UTF-8)” part. Is there anyway to make HTMLExecutable send the header without the last part, without making a completely custom activation macro?
No, by default, HTMLEXE is completely Unicode-enabled and it will send/read data in UTF-8 format. The activation kit is also able to deal with UTF-8, so it’s strange that this UTF-8 header is the culprit. Did you customize the PHP code?
The PHP code was not modified. Apparently, the server throws the 502 error because of the header even before the PHP script begins execution.
I am currently trying to manually recreate the activation process and am having some difficulty in using the RegisterPub script. For example, if I get the following from the activation server:
Which of these should be passed on to RegisterPub? Also, is the first parameter of RegisterPub the name of the certificate I am trying to register? I am trying with RegisterPub(“Registered”, “Name Surname”, “Company”, “8036024463”); but it does not seem to work.
EDIT: I have figured it out - RegisterPub does not take information about which certificate you are trying to register. Proper use seems to be: RegisterPub(“Name Surname”, “Company”, “”, “8036024463”);
Check whether you do not have some warning or hint generated by PHP. This would explain why you have some additional header.