Enable CORS in .NET Core Web API

// Startup.cs

public void ConfigureServices(IServiceCollection services)
{
        // ...
        CorsConfig(services);
        // ...
}

public void Configure(IApplicationBuilder app, IApiVersionDescriptionProvider provider)
{
        // ...
        CorsConfig(app);        
        // ...
}

readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
private void CorsConfig(IApplicationBuilder app)
{
    app.UseCors(MyAllowSpecificOrigins);
}
private void CorsConfig(IServiceCollection services)
{
    services.AddCors(options =>
    {
        options.AddPolicy(MyAllowSpecificOrigins,
        builder =>
        {
            builder.WithOrigins("http://localhost.com");
        });
    });
}

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)’: /simple/pylint/ >>>>>>>> Could not fetch URL https://pypi.python.org/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.python.org’, port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)’),)) – skipping



// add the following flag to the pip command:

--trusted-host files.pythonhosted.org --trusted-host pypi.org

// or wherever the error indicates a problem in

HTTPSConnectionPool(host='pypi.python.org', port=443)