86a6db2003-04-26Marcus Agehall /*
2ed3622010-11-02Martin Stjernholm  * $Id$
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__
2ed3622010-11-02Martin Stjernholm // Cannot dump this since the #if constant(...) check below may depend // on the presence of system libs at runtime. constant dont_dump_program = 1;
6f7b202004-04-16Henrik Grubbström (Grubba) #if constant(Mysql.mysql.CLIENT_SSL)
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 }
445e8d2010-11-02Martin Stjernholm  #else constant this_program_does_not_exist = 1;
86a6db2003-04-26Marcus Agehall #endif