<commit_before>/**
 * Adjusting for certificate issues
 * - This was needed for GeneMatcher node certificate issues
 * This feature is only needed for connecting to staging servers with
 * self signed certificates. Production systems will not need this
 */
package org.broadinstitute.macarthurlab.matchbox.network;


import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.*;

/**
 * A {@link X509TrustManager} and {@link HostnameVerifier} which trust everything.
 * 
 * @author    <NAME>
 * @license   http://creativecommons.org/licenses/by/3.0/
 * @see       http://www.geekality.net/?p=2408
 */
public final class CertificateAdjustment implements X509TrustManager, HostnameVerifier
{
    public X509Certificate[] getAcceptedIssuers() {return null;}
    public void checkClientTrusted(X509Certificate[] certs, String authType) {}
    public void checkServerTrusted(X509Certificate[] certs, String authType) {}
    public boolean verify(String hostname, SSLSession session) {return true;}
    
    /**
     * Installs a new {@link TrustAllCertificates} as trust manager and hostname verifier. 
     */
    public static void install()
    {
        try
        {
        	CertificateAdjustment trustAll = new CertificateAdjustment();
            
            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance("SSL");<commit_msg>Added in a warning to use certificate adjustment ONLY in staging servers and not in production.<commit_after>/**
 * IMPORTANT NOTE: TO BE ONLY USED WITH TRUSTED STAGING SERVERS AND NOT IN PRODUCTION
 * Adjusting for certificate issues
 * 
 * This feature is only needed for connecting to staging servers with
 * self signed certificates. Production systems will not need this
 */
package org.broadinstitute.macarthurlab.matchbox.network;


import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.*;

/**
 * IMPORTANT NOTE: TO BE ONLY USED WITH TRUSTED STAGING SERVERS AND NOT IN PRODUCTION
 * Thank you to <NAME> who was listed as author from where this was borrowed from as license allows
 * 
 * @author    <NAME>
 * @license   http://creativecommons.org/licenses/by/3.0/
 * @see       http://www.geekality.net/?p=2408
 */
public final class CertificateAdjustment implements X509TrustManager, HostnameVerifier
{
    public X509Certificate[] getAcceptedIssuers() {return null;}
    public void checkClientTrusted(X509Certificate[] certs, String authType) {}
    public void checkServerTrusted(X509Certificate[] certs, String authType) {}
    public boolean verify(String hostname, SSLSession session) {return true;}
    
    /**
     * Installs a new {@link TrustAllCertificates} as trust manager and hostname verifier. 
     */
    public static void install()
    {
        try
        {
        	CertificateAdjustment trustAll = new CertificateAdjustment();
            
            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance("SSL");
{'fraction_non_alphanumeric': 0.08183453237410072, 'fraction_numerical': 0.013489208633093525, 'mean_word_length': 3.7945402298850577, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3877454', 'n_tokens_mistral': 914, 'n_tokens_neox': 853, 'n_words': 287}