Unidac http tunnel not working

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Unidac http tunnel not working

Post by NAlexl » Tue 21 Feb 2017 17:50

I am testing the unidac for 60 days to connect to a wordpress databse mariadb.

I uploaded the file tunnel.php and i already checked that its installed.

"DevartHttpTunnel v1.69
Tunnel script is installed correctly.
You can establish connections through the HTTP tunnel."

I tried with dbforge and it Works with that script but i cannot connect with unidac.

Here is my unidac connection string:

Provider Name=MySQL;User ID=xxx;Password=xxx;Data Source=site.com;Database=databasename;Port=3306;Protocol=mpHttp;Http Url=https://site.com/tunnel.php;Login Prompt=False

Why dbforge Works and unidac doesn't?

It does work with direct connection if the webhosting provider add my ip with protocol in mpdefault

Thanks in advance

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Wed 22 Feb 2017 10:19

Please make sure that you should use HTTPS protocol tunneling, but not HTTP protocol tunneling. If you require HTTP protocol tunneling - specify the URL of the script location the following format: http://site.com/tunnel.php instead of https://site.com/tunnel.php.
HTTPS protocol tunneling is only supported when using the TCRSSLIOHandler component. To use HTTPS protocol tunneling, please place on the form the TCRSSLIOHandler component and assign it to the TUniConnection.IOHandler property.
The TCRSSLIOHandler component is located in the dcldacsbridgeXXX package. This package is included in the UniDAC demos. See the package installation instructions in the file "%UniDACDemos%\TechnologySpecific\SecureBridge\Readme.html", where %UniDACDemos% is the UniDAC Demo projects installation path on your computer.

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Wed 22 Feb 2017 22:40

Thank you very much for your quick answer!

I could not install that component, 'sbridge240' not found...

Thank you in advance!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Thu 23 Feb 2017 09:16

This error occurs because our product SecureBridge is not installed on your machine. To solve the problem, you can use the SecureBridge trial edition: https://www.devart.com/sbridge/download.html

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Thu 23 Feb 2017 18:07

After install secure bridge i could not compile dacbridge240.

3 errors:

1- [dcc32 Error] CRSSLIOHandler.pas(158): E2009 Incompatible types: 'Parameter lists differ' SSLClient.OnServerCertValidate := DoServerCertValidate;

2- FOnServerCertValidate(Self, ServerCertificate, Accept);

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Thu 23 Feb 2017 18:25

2- [dcc32 Error] CRSSLIOHandler.pas(292): E2010 Incompatible types: 'TList' and 'Boolean'

FOnServerCertValidate(Self, ServerCertificate, Accept);

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Fri 24 Feb 2017 08:33

For successful compilation of the dcldacsbridgeXXX package package, please try to use the next CRSSLIOHandler.pas file: http://www.devart.com/pub/dac/crssliohandler.zip

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Fri 24 Feb 2017 17:44

I still cannot connect.

I assign TCRSSLIOHandler component it to the TUniConnection.IOHandler property
and changed my protocol to mpSSLHttp.

My connectin string is;
Provider Name=MySQL;
User ID=user;Password=password;
Data Source=site.com;Database=database;Port=3306;Protocol=mpSSLHttp;Http Url=https://site.com/tunnel.php;Login Prompt=False

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Fri 24 Feb 2017 20:33

Please, try to set the Protocol property to mpHTTP instead of mpSSLHTTP.

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Sat 25 Feb 2017 09:40

I still cannot connect wit mpHTTP, i tried with both.

What is strange is that with http tunnel in dbforge i can connect.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Mon 27 Feb 2017 10:36

To investigate this UniDAC behavior, please send us using the contact form https://www.devart.com/company/contactform.html the connection string used when working with dbForge Studio for MySQL.

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Mon 27 Feb 2017 17:39

Ok!
In the form i have to explain everything again right?
I choose the product unidac or dbforge?

Anyway here is the DBforge connection string:
User Id=user;Host=site.com;Database=database;Protocol=Http;Character Set=utf8;HTTP Url=https://site.com/tunnel.php;HTTP Keep Alive=0;HTTP Base64=False

Thanks

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Mon 27 Feb 2017 19:15

The UniConnection.Server property contains the address of the MySQL server relative to the PHP server. If the MySQL server is on the same machine with the PHP server, then the UniConnection.Server property must be set to "127.0.0.1".
We cannot reproduce the specified problem. Please compose a small test project to reproduce it and send us via the contact form on our website: https://www.devart.com/company/contactform.html Also provide the full error message.

NAlexl
Posts: 9
Joined: Tue 21 Feb 2017 08:47

Re: Unidac http tunnel not working

Post by NAlexl » Thu 02 Mar 2017 09:30

Thank you very much for your help!!

I have made the connection!

Best regards!!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Unidac http tunnel not working

Post by ViktorV » Fri 03 Mar 2017 07:40

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

Post Reply