30 Commits

Author SHA1 Message Date
Markus Mäkelä
38b57497b9
MXS-2486: Move to_string into SSLProvider
The functionality is more a part of the provider than the context so it
should be defined in it. It also doesn't use any parts of the SSLContext
which makes it somewhat more clear that it doesn't belong there.
2019-05-28 14:34:50 +03:00
Markus Mäkelä
cab35b2dea
MXS-2486: Fix listener serialization
The serialization should be done via the parameters. This also makes
SSLContext::serialize redundant.
2019-05-28 14:34:50 +03:00
Markus Mäkelä
859e930466
MXS-2486: Make SSL configurations immutable
Changes to SSL configurations is expected to be rare which allows them to
be made into immutable objects once created. This is an acceptable
compromise between performance and usability.
2019-05-24 15:33:18 +03:00
Markus Mäkelä
c2975d33f8
MXS-2483: Fix dcb.hh includes
The header depended on ssl.hh to include the OpenSSL headers even though
it used OpenSSL types. By fixing these dependencies the ssl.h header can
now freely include the rworker_local type which removes the need for the
hidden implementation of SSLProvider.
2019-05-24 15:33:18 +03:00
Markus Mäkelä
cb72b2a5cc
MXS-2483: Move SSL functionality into SSLProvider
The class is intended to be inherited by objects that need an SSL context
and a configuration. In practice this will be servers and listeners.

The SSLContext is stored in a rworker_local shared_ptr that makes it
possible to update safely. As the copying is always done behind a lock the
cached local value always holds a valid SSLContext instance for the
duration of all function calls.

Using the pImpl idiom, the routingworker.hh header is not exposed in the
ssl.hh header. This allows the SSLProvider class to be inherited more
easily.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
8a4b58d52c
MXS-2483: Move SSL configuration into SSLConfig
This way the configuration information can be accessed without the
SSLContext.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
4e2d350838
MXS-2483: Return std::unique_ptr from SSLContext::create
Smart pointers are far nicer than raw pointers.
2019-05-24 10:05:43 +03:00
Markus Mäkelä
68ad51bc52
MXS-2483: Address review comments 2019-05-20 15:46:53 +03:00
Markus Mäkelä
08bb5d009d
MXS-2483: Make some SSLContext methods const
The serialization and opening of a new SSL session can be const.
2019-05-20 15:46:53 +03:00
Markus Mäkelä
73796be9d6
MXS-2483: Make SSLContext a C++ class
The class now encapsulates all the functionality that is related to
setting up a SSL context.
2019-05-20 15:45:18 +03:00
Markus Mäkelä
1197bd40db
MXS-2483: Move unwanted SSL code to mysql_client.cc
The code was only used by mysql_client.cc and should therefore be located
in it.
2019-05-20 15:45:18 +03:00
Markus Mäkelä
cab336ed89
MXS-2483: Rename SSL_LISTENER to mxs::SSLContext 2019-05-20 15:45:18 +03:00
Markus Mäkelä
d203e7af83
Move SSL related code into ssl.cc
The code was in the listener sources but was shared by both listeners and
servers.
2019-05-10 09:21:52 +03:00
Johan Wikman
1fed465fdb MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names.
Now the names are in SERVICE and they must be accessed via member
function.
2019-02-14 15:24:10 +02:00
Johan Wikman
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
Esa Korhonen
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
Markus Mäkelä
43c33e9f4a
MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB
have a null session. This further clarifies the concept of the session and
also allows the listener reference to be moved there.

Ideally, the session itself would allocate and assign the client DCB but
since the Listener is the only one who does it, it's acceptable for now.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
ad12ff6d06
MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
Markus Mäkelä
a10b6c2e89
MXS-2196: Take Listener into use 2018-12-04 11:39:52 +02:00
Markus Mäkelä
77585bdb8c
MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Johan Wikman
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
Johan Wikman
9a8bb95be6 MXS-2014 Rename mxs_log_priority_is_enabled
- Renamed to mxs_log_is_priority_enabled
- That function instead of the macro is now consistently used
2018-08-16 09:59:43 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
afcb708e6e Merge branch '2.1' into 2.2 2017-11-21 16:49:21 +02:00
Markus Mäkelä
486024aaf4 MXS-1390: Add missing SSL parameter processing to servers resource
Added missing SSL parameters to servers resource output as well as added
the processing of these parameters when servers are created. It is
preferable to define servers as either encrypter or plain and to prevent
the modification of this at runtime.
2017-09-11 12:49:11 +03:00
Esa Korhonen
ed05d24a9a Move SSL-code in mysql_auth.c and pam_client_session.cc to
a separate function in ssl.cc

Removes some duplicate code.
2017-08-07 12:22:59 +03:00
Markus Mäkelä
26bf342e6b Merge branch '2.1' into develop 2017-07-24 12:37:25 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Johan Wikman
8d7653bdff Compile listener and ssl as C++ 2017-03-24 11:11:15 +02:00