Problem connecting to MySQL database through ssl (https) protocol...

786 views
Skip to first unread message

VÍT KETTNER

unread,
May 13, 2013, 8:36:21 AM5/13/13
to manydesign...@googlegroups.com
Hello,

I have troubles to connect to an external MySQL database which is deployed on a server (Apache) run throught the https protocol. When I try to connect to the database via 443 port I get the following message:

Couldn't read schema names from db: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Is there anything wrong with the connection if I try url like this:

jdbc:mysql://<subdomain.domain.cz:443/<databasename>

Is there any problem with the ssl protocol used on a server with the database? For example if I try to display the web in the browser like http://subdomain.domain.cz:443
then I get this message:


Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Can the connection wizzard handle the SSL secured connection?

Many thanks for your help.
V. Kettner

Giampiero Granatella

unread,
May 13, 2013, 8:42:38 AM5/13/13
to manydesign...@googlegroups.com
Hi Vit,
I think that you have to specify that you'll use an encrypted connection in the jdbc url.
e.g. jdbc:mysql://host/database?verifyServerCertificate=false&useSSL=true&requireSSL=true

Ciao
Giampiero



2013/5/13 VÍT KETTNER <vit....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

VÍT KETTNER

unread,
May 14, 2013, 5:57:49 AM5/14/13
to manydesign...@googlegroups.com
Many thanks for your help.
Eventually, the problem was not in the SSL, but in the settings of the external database server which did not allow connections other than from localhost. We have already successfully connected to the database given that:

1) MySQL server has to allow external connections from other interfaces than just local host
2) To fix the error message Host ... is not allowed to connect to this MySQL server there must be a row in the user table with a Host value that matches the client host by setting up an account with the combination of client host name and user name that we are using when trying to connect.

Best wishes,
Vít

Dne pondělí, 13. května 2013 14:42:38 UTC+2 Giampiero Granatella napsal(a):
Hi Vit,
I think that you have to specify that you'll use an encrypted connection in the jdbc url.
e.g. jdbc:mysql://host/database?verifyServerCertificate=false&useSSL=true&requireSSL=true

Ciao
Giampiero



2013/5/13 VÍT KETTNER <vit....@gmail.com>
Hello,

I have troubles to connect to an external MySQL database which is deployed on a server (Apache) run throught the https protocol. When I try to connect to the database via 443 port I get the following message:

Couldn't read schema names from db: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Is there anything wrong with the connection if I try url like this:

jdbc:mysql://<subdomain.domain.cz:443/<databasename>

Is there any problem with the ssl protocol used on a server with the database? For example if I try to display the web in the browser like http://subdomain.domain.cz:443
then I get this message:


Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Can the connection wizzard handle the SSL secured connection?

Many thanks for your help.
V. Kettner

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.

Reply all
Reply to author
Forward
0 new messages