package ru.yandex.qe.dispenser.domain.util;

import java.security.GeneralSecurityException;

import javax.net.ssl.SSLContext;

import org.postgresql.ssl.WrappedFactory;

import ru.yandex.qe.http.certificates.TrustManagersProvider;

public final class YaCertValidatingFactory extends WrappedFactory {
    public YaCertValidatingFactory() throws GeneralSecurityException {
        final SSLContext ctx = SSLContext.getInstance("TLS");
        ctx.init(null, TrustManagersProvider.getInstance().getTrustManagers(), null);
        factory = ctx.getSocketFactory();
    }
}
