All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.ext.mongo.impl.config.SSLSettingsParser Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.ext.mongo.impl.config;

import com.mongodb.ConnectionString;
import com.mongodb.connection.SslSettings;
import io.vertx.core.json.JsonObject;

/**
 * @author Nick Scavelli
 */
public class SSLSettingsParser {
  private final SslSettings settings;

  public SSLSettingsParser(ConnectionString connectionString, JsonObject config) {
    SslSettings.Builder settings = SslSettings.builder();
    Boolean ssl;
    if (connectionString != null) {
      ssl = connectionString.getSslEnabled();
    } else {
      ssl = config.getBoolean("ssl");
    }

    if (ssl != null) {
      settings.enabled(ssl);
    }
    this.settings = settings.build();
  }

  public SslSettings settings() {
    return settings;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy