Default SSL Settings

デフォルト設定では、CData Virtuality Server  はポート31001経由で証明書不要のSSL接続を提供します。このシナリオでは、SSLスイートTLS_DH_anon_WITH_AES_128_CBC_SHAが使用されます。ただし、CData Virtuality Server は、セキュリティ設定をいくつか変更することで、カスタム証明書を使用するように設定できます。 

If you implement the usage of your own certificate, you also need to configure the Studio to accept this certificate with the means of a truststore. If you want to implement 2-way authentication, you must also deploy a client certificate at the client machine and a truststore, which accepts the client certificate, at the server.

Configure the Server to Use a Certificate

1a) New Self-Signed Certificate

すでに証明書をお持ちの方は、この部分を飛ばしてステップ1b)にお進みください。そうでない場合は、次の3つのステップで、暗号化キー、証明書、および証明書が信頼済みとしてリストされているトラストストアを持つキーストアを作成します。 

以下のコマンドは、証明書と対応する公開鍵/秘密鍵をkeystoreファイルとtruststoreファイルに生成します。鍵ストア、証明書、およびトラストストアの名前は提案であり、証明書を装備したいサーバまたはクライアントが複数ある場合は、ファイル名にサーバ名とクライアント名を含めることをお勧めします。どちらのサブセクションにも356日間有効な鍵を作成するコマンドが含まれており、別の有効期間を定義することもできます。 

1-Way Authentication

昇格コマンドプロンプトで以下の手順を実行します。該当する場合、 インタラクティブ・コマンド内に必要な詳細 。 

keytool -genkey -alias dv_server -keyalg RSA -validity 365 -keystore dv_jdbc_server.keystore -storetype JKS
keytool -export -alias dv_server -keystore dv_jdbc_server.keystore -rfc -file dv_server_public.cert
keytool -import -alias dv_server -file dv_server_public.cert -storetype JKS -keystore dv_jdbc_server.truststore

各サーバーは正確に1つのキーストアを使用し、各クライアントは正確に1つのトラストストアを使用することに注意してください。複数のサーバを配備している場合は、すべてのサーバの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、c) のコマンドを各サーバー証明書について、常に同じサーバーのトラストストア・ファイルを宛先として 1 回実行します。 

2-Way Authentication

昇格コマンドプロンプトで以下の手順を実行します。該当する場合、 インタラクティブ・コマンド内に必要な詳細 。

# Make sure that the key password is the same as the keystore password when entering the details
keytool -genkey -alias dv_server -keyalg RSA -validity 365 -keystore dv_jdbc_server.keystore -storetype JKS
keytool -export -alias dv_server -keystore dv_jdbc_server.keystore -rfc -file dv_server_public.cert
# Make sure that the key password is the same as the keystore password when entering the details
keytool -genkey -alias dv_client -keyalg RSA -validity 365 -keystore dv_jdbc_client.keystore -storetype JKS
keytool -export -alias dv_client -keystore dv_jdbc_client.keystore -rfc -file dv_client_public.cert
keytool -import -alias dv_server -file dv_server_public.cert -storetype JKS -keystore dv_jdbc_server.truststore
keytool -import -alias dv_client -file dv_client_public.cert -storetype JKS -keystore dv_jdbc_client.truststore

各サーバーは正確に1つのキーストアを使用し、各クライアントは正確に1つのトラストストアを使用することに注意してください。複数のサーバをデプロイしている場合は、すべてのサーバの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、各サーバー証明書について、常に同じサーバー・トラストストア・ファイルを宛先として、EXECUTE)のコマンドを1回実行します。

複数のクライアントをデプロイしている場合は、すべてのクライアントの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、常に同じクライアント・トラストストア・ファイルを宛先として、手順f)のコマンドを各クライアント証明書に対して1回実行します。

1b) Existing Certificate

ステップ1a)で新しい自己署名証明書を作成した場合は、この部分をスキップしてステップ2に進んでください。

1-Way Authentication

昇格コマンドプロンプトで以下の手順を実行します。該当する場合、 インタラクティブ・コマンド内に必要な詳細 。 

# Make sure that the keystore password is the same as the certificate's key password
keytool -import -alias dv_server -file %pathToCertificateFile% -keystore dv_jdbc_server.keystore -storetype JKS
keytool -export -alias dv_server -keystore dv_jdbc_server.keystore -rfc -file dv_server_public.cert
keytool -import -alias dv_server -file dv_server_public.cert -storetype JKS -keystore dv_jdbc_server.truststore

各サーバーは正確に1つのキーストアを使用し、各クライアントは正確に1つのトラストストアを使用することに注意してください。複数のサーバをデプロイしている場合は、すべてのサーバの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、c) のコマンドを各サーバー証明書ごとに、常に同じサーバーの Truststore ファイルを宛先として 1 回実行します。 

2-Way Authentication

昇格コマンドプロンプトで以下の手順を実行します。該当する場合、 インタラクティブ・コマンド内に必要な詳細 。 

# Make sure that the keystore password is the same as the certificate's key password
keytool -import -alias dv_server -file %pathToServerCertificateFile% -keystore dv_jdbc_server.keystore -storetype JKS
keytool -export -alias dv_server -keystore dv_jdbc_server.keystore -rfc -file dv_server_public.cert
# Make sure that the keystore password is the same as the certificate's key password
keytool -import -alias dv_server -file %pathToClientCertificateFile% -keystore dv_jdbc_client.keystore -storetype JKS
keytool -export -alias dv_client -keystore dv_jdbc_client.keystore -rfc -file dv_client_public.cert
keytool -import -alias dv_server -file dv_server_public.cert -storetype JKS -keystore dv_jdbc_server.truststore
keytool -import -alias dv_client -file dv_client_public.cert -storetype JKS -keystore dv_jdbc_client.truststore

各サーバーは正確に1つのキーストアを使用し、各クライアントは正確に1つのトラストストアを使用することに注意してください。複数のサーバをデプロイしている場合は、すべてのサーバの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、e) のコマンドを各サーバー証明書ごとに、常に同じサーバーの Truststore ファイルを宛先として 1 回実行します。

複数のクライアントをデプロイしている場合は、すべてのクライアントの証明書の公開鍵を含む1つのトラストストアが必要です。これを行うには、f)のコマンドを各クライアント証明書ごとに、常に同じクライアント・トラストストア・ファイルを宛先として1回実行します。

2) Place the Files in the Server Location

1-Way Authentication

  • dv_jdbc_server.keystoreファイルを%dvDir%/standalone/configurationフォルダに配置します。複数のサーバーがある場合は、サーバーごとに、対応する keystore ファイルを使用して毎回これを行う必要があります。 

2-Way Authentication

  • dv_jdbc_server.keystoreファイルを%dvDir%/standalone/configurationフォルダに配置します。複数のサーバーがある場合は、サーバーごとに、対応する keystore ファイルを使用して毎回これを行う必要があります;
  • %dvDir%/standalone/configurationフォルダにdv_jdbc_client.truststoreファイルを配置します。複数のサーバーがある場合は、すべてのサーバーで、毎回同じトラストストア・ファイルでこれを行う必要があります。トラストストアは、CData Virtuality 環境で使用するすべてのクライアント証明書の公開鍵を含む必要があることを忘れないでください。

3) Configure the SSL Settings

1-Way Authentication

%dvDir%/standalone/configuration/dvserver-standalone.xmlファイルを以下のように変更します。XML部分を置き換えます:

<transport name="jdbc-ssl" socket-binding="dv-jdbc-ssl" protocol="teiid">
<authentication security-domain="dv-security"/>
<ssl mode="enabled" authentication-mode="anonymous" ssl-protocol="SSLv3"/>
</transport>

NEWと一緒に:

<transport name="jdbc-ssl" socket-binding="dv-jdbc-ssl" protocol="teiid">
<authentication security-domain="dv-security"/>
<ssl mode="enabled" ssl-protocol="SSLv3" keymanagement-algorithm="SunX509">
<keystore name="../standalone/configuration/dv_jdbc_server.keystore" password="serverKeystorePw"/>
</ssl>
</transport>

 ファイル名とパスワードは、設定に応じて置き換えてください。

2-Way Authentication

%dvDir%/standalone/configuration/dvserver-standalone.xmlファイルを以下のように変更します。XML 部分を

<transport name="jdbc-ssl" socket-binding="dv-jdbc-ssl" protocol="teiid">
<authentication security-domain="dv-security"/>
<ssl mode="enabled" authentication-mode="anonymous" ssl-protocol="SSLv3"/>
</transport>

新しいものと置換します:

<transport name="jdbc-ssl" socket-binding="dv-jdbc-ssl" protocol="teiid">
<authentication security-domain="dv-security"/>
<ssl mode="enabled" ssl-protocol="SSLv3" keymanagement-algorithm="SunX509">
<keystore name="../standalone/configuration/dv_jdbc_server.keystore" password="serverKeystorePw"/>
<truststore name="../standalone/configuration/dv_jdbc_client.truststore" password="clientTruststorePw"/>
</ssl>
</transport>

ファイル名とパスワードは、設定に応じて置き換えてください。

Overview of All Properties

設定可能なプロパティは以下のとおりです:

Property

Description

mode

Can have one of the following values: disabled|login|enabled

  •  disabled: no transport or message-level security will be used
  • login: only the login traffic will be encrypted at a message level using 128 bit AES with an ephemeral DH key exchange. No other config values are needed in this mode
  • enabled: traffic will be secured using the other configuration properties

ssl-protocol

Type of SSL protocol to be used. Default: TLSv1. Other possible value: TLSv1.2, TLSv1.1, SSLv3

keystore/type

Keystore type created by the keytool. Default: JKS

authentication-mode

SSL authentication mode. Can have one of the following values: anonymous|1-way|2-way

keymanagement-algorithm

Type of key algorithm used. Default is based upon the VM, usually SunX509

keystore/name

File name of the keystore containing the Server's private key. The file name is the path to the file-based relative to the working directory of the CData Virtuality Server

keystore/password

Password for the keystore

truststore/name

if authenticationMode is set to 2-way, this property must be provided. This is the truststore that contains the public key of the client. Depending on how you created the keystore and truststores, this may be the same file as defined under the keystore/name property

truststore/password

Password for the truststore

enabled-cipher-suites

Comma-separated list of cypher suites allowed for encryption between server and client. The values must be valid supported cypher suites; otherwise, SSL connections will fail

Configuring the Studio to Accept the Certificate

1) Place the files in the Studio's Location

1-Way Authentication

  • dv_jdbc_server.truststoreファイルを CData Virtuality Studio のdirectフォルダ(dvstudio.iniファイルがある場所と同じ)に配置します。複数のクライアントがある場合、すべてのサーバーで、毎回同じトラストストア・ファイルでこれを行う必要があります。トラストストアは、CData Virtuality 環境で使用するすべてのサーバー証明書の公開鍵を含んでいる必要があります。

2-Way Authentication

  • dv_jdbc_server.truststoreファイルを CData Virtuality Studio のdirectフォルダ(dvstudio.iniファイルがあるのと同じ場所)に置きます。複数のクライアントがある場合は、すべてのサーバーで、毎回同じトラストストア・ファイルでこれを行う必要があります。トラストストアは、CData Virtuality 環境で使用するすべてのサーバー証明書の公開鍵を含んでいる必要があります。
  • dv_jdbc_client.keystoreファイルをCData Virtuality Studio のdirectフォルダ(dvstudio.iniファイルがある場所と同じ)に配置します。複数のクライアントがある場合は、各クライアントごとに、対応するキーストアファイルで毎回これを行う必要があります。

2) Configure CData Virtuality Studio

1-Way Authentication

%dvStudioDir%/dvstudio.iniファイルの一番下に以下の行を追加し、ファイル名とパスワードをセットアップに応じて置き換えてください:

-Djavax.net.ssl.trustStore=dv_jdbc_server.truststore
-Djavax.net.ssl.trustStorePassword=serverTruststorePw
-Djavax.net.ssl.keyStoreType=JKS

2-Way Authentication

%dvStudioDir%/dvstudio.iniファイルの一番下に以下の行を追加し、ファイル名とパスワードをセットアップに応じて置き換えてください:

-Djavax.net.ssl.keyStore=dv_jdbc_client.keystore
-Djavax.net.ssl.keyStorePassword=clientKeyStorePw
-Djavax.net.ssl.trustStore=dv_jdbc_server.truststore
-Djavax.net.ssl.trustStorePassword=serverTruststorePw
-Djavax.net.ssl.keyStroreType=JKS

エラー

Studio Shows 'Remote host closed during handshake'

  • 鍵ストアに関するサーバーの設定を確認してください;
  • dvserver-standalone.xmlファイルにファイルがアクセス可能で、スペルが正しいことを確認してください;
  • dvserver-standalone.xmlファイルで正しいキーストアパスワードが使用されていることを確認します;
  • 詳細はserver.logファイルを確認してください。 

The trustAnchors parameter must be non-empty

このエラーは、truststore ファイルを開くことができないことを意味します。以下はそのチェック項目です:

  • スペルとアクセス権を確認してください;
  • 1-way 認証が使用されている場合は、Studio ファイルの構成を確認してください;
  • 双方向認証の場合は、サーバーの設定も確認してください。 

java.security.NoSuchAlgorithmException: TSLv1 SSLContext not available

  • 使用する証明書がすべてセキュリティタイプをサポートしていることを確認してください;
  • あるいは、ssl-protocolの設定値として、SSLv3を試してみてください。 

PKIX path building failed: ...unable to find valid certification path to requested target

  • サーバーとクライアント間の関係するトラストストアにアクセスでき、構成されていることを確認します;
  • 1-way 認証が使用されている場合は、Studio の設定を確認してください;
  • 双方向認証の場合は、サーバーの設定も確認してください。