Skip to content

Instantly share code, notes, and snippets.

View derdaani's full-sized avatar

Daniel Valenti derdaani

View GitHub Profile
@derdaani
derdaani / git_ssl_self_signed.md
Created November 14, 2022 14:20 — forked from peschee/git_ssl_self_signed.md
Disable SSL verification in git repositories with self-signed certificates

Sometimes, we have to access git repositories over SSL and the server only provides a self-signed certificate 🙈. Although there are ways to increase the trust level for the self-signed certificate (https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html, https://confluence.atlassian.com/bitbucketserverkb/resolving-ssl-self-signed-certificate-errors-806029899.html), my recommendation is to just ignore SSL verification alltogether.

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet.

Run git config http.sslVerify false to disable SSL verification if you're working with a checked out repository already.

@derdaani
derdaani / service.spec.ts
Created March 24, 2020 09:57
Jasmine mock getters, class variables, class functions
describe('Service Test', () => {
let service: SomeService;
let stubbedService: jasmine.SpyObj<StubbedService>;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{
provide: StubbedService,
useValue: {