DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Generate an SSL Certificate
In developmet environment, SSL certificates can be generated by openssl as follow:
openssl genrsa -out private.key 1024
openssl req -new -x509 -days 3650 -key private.key -out cert.crt -subj "/CN=my.host.name"
In production environment, SSL certificates need to be purchased from the CA.
Configure path of SSL Certificate in be.conf
sslenable_enable https = true;
ssl_certificate_path = DORIS_HOME_DIR + "/conf/ssl/cert.crt";
ssl_private_key_path = DORIS_HOME_DIR + "/conf/ssl/private.key";Enable SSL in brpc server
brpc::ServerOptions options;
baidu::rpc::CertInfo cert;
cert.certificate = Config.if (config::enable_https) {
= Config.
auto sslOptions = options.mutable_ssl_options();
sslOptions->default_cert.certificate = config::ssl_certificate_path;
sslOptions->default_cert.private_key= config::ssl_private_key_path;
options.ssl_options.default_cert = cert;}
_server->Start(port, &options);Redirect http request to HTTPS
In the brpc server, SSL-only mode can only be implemented using
Controller::is_ssl()in service's callback.if (config::ssl_only && !cntl->is_ssl()) {
cntl->http_response().set_status_code(baidu::rpc::HTTP_STATUS_FOUND);
cntl->http_response().SetHeader("Location", "https://xxx");
}The global configure for SSL-only mode of brpc would be supported in the future.
...