Skip to content

Instantly share code, notes, and snippets.

@axdiamond
axdiamond / steps.md
Last active October 2, 2018 14:23
Unable to get local issuer certificate

NOTE: If you're not expecting to be behind some firewall, Do not follow these steps. You are possibly being man-in-the-middled and should verify that first

This error is thrown when the TLS certificate that is used to secure a request has a Root CA that isnt trusted by the verifying program. This happens at many companies due to firewall configuration. They will usually terminate all requests to inspect them, then reencrypt the request with its own CA cert.

Normally, this isnt an issue because the Windows Certificate Store, the collection of CA certificates that windows trust, is controlled by group policy and will have ITs's certificate installed.

However, many cross platform applications dont use the Windows Certificate Store for some reason. They often will use the library OpenSSL to handle SSL/TLS requests. OpenSSL comes with a list of publicly trusted certificates, and only refers to this list when it verifies a request. This leads to security errors like 'Unable to get local issuer certificate' to

Write-Host 'Hi gary!'
<#
Quick little script to set credentials on IIS sites
#>
Import-Module WebAdministration
$dev_username = ''
$dev_password = ''
$qa_username = ''
Param
(
[parameter(Mandatory=$true, ValueFromPipeline=$true)]
[alias("p","name")]
[String]
$projectName
)
$ErrorActionPreference = "Stop"
$projectname = $projectname.Trim()
@axdiamond
axdiamond / Set-AspNetCoreEnviromentVars.ps1
Created April 12, 2018 18:27
Powershell to set ASP Core Environment Variables
#Requires -RunAsAdministrator
$SiteName = "TEST"
$EnvVars = @(
@{Name="ENVIROMENT"; Value="Prod"},
@{Name="LoggingMode"; Value="Verbose"}
);
function Set-AspNetCoreEnviromentVars {
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
namespace Dal
{
(function () {
let Andrew = { name: 'Andrew', debts: []},
Justin = { name: 'Justin', debts: []},
Jon = { name: 'Jon', debts: []},
Zach = { name: 'Zach', debts: []};
let people = [
Andrew,
Justin,
Jon,