| | |
| | | |
| | | import static org.opends.server.messages.ToolMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.loggers.Debug.*; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class SSLConnectionFactory |
| | | { |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.tools.SSLConnectionFactory"; |
| | | |
| | | private SSLSocketFactory sslSocketFactory = null; |
| | | |
| | |
| | | |
| | | } catch(Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "getKeyManagers", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_TOOLS_CANNOT_LOAD_KEYSTORE_FILE; |
| | | throw new SSLConnectionException(getMessage(msgID, keyStoreFile), e); |
| | | } |
| | |
| | | return keyManagerFactory.getKeyManagers(); |
| | | } catch(Exception ke) |
| | | { |
| | | assert debugException(CLASS_NAME, "getKeyManagers", ke); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ke); |
| | | } |
| | | int msgID = MSGID_TOOLS_CANNOT_INIT_KEYMANAGER; |
| | | throw new SSLConnectionException(getMessage(msgID, keyStoreFile), ke); |
| | | } |
| | |
| | | inputStream.close(); |
| | | } catch(Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "getTrustManagers", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_TOOLS_CANNOT_LOAD_TRUSTSTORE_FILE; |
| | | throw new SSLConnectionException(getMessage(msgID, trustStoreFile), e); |
| | | } |
| | |
| | | return trustManagerFactory.getTrustManagers(); |
| | | } catch(Exception ke) |
| | | { |
| | | assert debugException(CLASS_NAME, "getTrustManagers", ke); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ke); |
| | | } |
| | | int msgID = MSGID_TOOLS_CANNOT_INIT_TRUSTMANAGER; |
| | | throw new SSLConnectionException(getMessage(msgID, trustStoreFile), ke); |
| | | } |