86a6db2003-04-26Marcus Agehall /* * Glue for the Mysql-module using SSL */
3937932003-04-27Henrik Grubbström (Grubba) //! Implements SQL-urls for //! @tt{mysqls://[user[:password]@@][hostname][:port][/database]@} //! //! Sets the connection to SSL-mode, and sets the default configuration //! file to @expr{"/etc/my.cnf"@}. //! //! @fixme
e0a6b02003-04-27Henrik Grubbström (Grubba) //! Ought to load a suitable default configuration file for Win32 too.
3937932003-04-27Henrik Grubbström (Grubba) //! //! @note //! This connection method only exists if the Mysql-module has been //! compiled with SSL-support.
86a6db2003-04-26Marcus Agehall  #pike __REAL_VERSION__
e1fb092014-02-14Martin Nilsson #require constant(Mysql.mysql.CLIENT_SSL)
86a6db2003-04-26Marcus Agehall 
e1fb092014-02-14Martin Nilsson // Cannot dump this since the #require check may depend on the // presence of system libs at runtime.
a59c792010-11-02Martin Stjernholm constant dont_dump_program = 1;
86a6db2003-04-26Marcus Agehall inherit Sql.mysql; void create(string host, string db, string user, string password,
3937932003-04-27Henrik Grubbström (Grubba)  mapping(string:mixed)|void options) { if (!mappingp(options)) options = ([ ]);
86a6db2003-04-26Marcus Agehall 
3937932003-04-27Henrik Grubbström (Grubba)  options->connect_options |= CLIENT_SSL;
86a6db2003-04-26Marcus Agehall 
3937932003-04-27Henrik Grubbström (Grubba)  if (!options->mysql_config_file) options->mysql_config_file = "/etc/my.cnf";
86a6db2003-04-26Marcus Agehall 
3937932003-04-27Henrik Grubbström (Grubba)  ::create(host||"", db||"", user||"", password||"", options);
86a6db2003-04-26Marcus Agehall }