001package io.prometheus.metrics.exporter.pushgateway;
002
003import java.io.IOException;
004import java.net.HttpURLConnection;
005import java.net.URL;
006
007/**
008 * This can be used for creating {@link Scheme#HTTP} and {@link Scheme#HTTPS} connections.
009 *
010 * <p>However, if you want to use it with {@link Scheme#HTTPS} you must make sure that the keychain
011 * for verifying the server certificate is set up correctly. For an example of how to skip
012 * certificate verification see {@code PushGatewayTestApp} in {@code
013 * integration-tests/it-pushgateway/}.
014 */
015public class DefaultHttpConnectionFactory implements HttpConnectionFactory {
016  @Override
017  public HttpURLConnection create(URL url) throws IOException {
018    return (HttpURLConnection) url.openConnection();
019  }
020}