Android Question httputils2 https Problem

CVR

Member
Licensed User
Hi, I'm using the httputils2 library to connect and query data to my mysql database. The problem is that I installed a security certificate on my server and httputils2 stopped working. How can I fix the problem. now I use https instead of http
 

DonManfred

Expert
Licensed User
Longtime User
The problem is that I installed a security certificate on my server and httputils2 stopped working
is it a trusted Certificate? If yes; it should work
If no: use the sourcemodules instead of the library, edit the httputils2service and change
B4X:
    hc.Initialize("hc")
to
B4X:
    hc.InitializeAcceptAll("hc")

PD: Make sure to use okhttputils2 and not the deprecated httputils2.
 
Last edited:
Upvote 0

CVR

Member
Licensed User
How can I use the source modules? Where do I find them and how do I edit them?

I really appreciate your help!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

CVR

Member
Licensed User
The server responds ResponseError. Reason: Internal Server Error, Response:
but this happens only when I use https. I'm using is sample example (webservice) example in b4x

$servidor="****";
$bd="****";
$usuario="****";
$clave="***";

$con= new mysqli($servidor,$usuario,$clave,$bd);;

$consulta=$con->query("SET CHARACTER SET utf8");
$query = file_get_contents("php://input");
$sth = $con->query($query);

if ($con->connect_errno) {
header("HTTP/1.1 500 Internala Server Error");
echo ($query.'\n');
echo($con->connect_error);
}
else
{
$rows = array();
while($r = $sth->fetch_assoc()) {
$rows[] = $r;
}
print json_encode($rows);
}
?>
 
Upvote 0

CVR

Member
Licensed User
Solved! I had two problems.
1) to connect to the server used https://domain.com
This was solved only with https://www.domain.com

2) I had problems when executing queries of type INSERT UPDATE OR DELETE
This was solved using a different webservice for this type of query.

Thank you!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…