polite-glass-8571
05/25/2023, 10:31 AMwww.mysite.com
I have a ssl certificate for this website that I have installed on my mac
I have a local reverse proxy that uses a trusted certificate, I can visit www.mysite.com
on a regular browser and it will show that the connection is trusted and secure ( green lock)
Due to cypress using its own proxy, it provides its own certificate when connecting to www.mysite.com
which is not installed on my mac, therefore the connection is marked as non-secure (red lock).
I have a script that runs on the app that I cannot modify and relies on being on that particular domain (www.mysite.com
) and having a secure connection ( green lock ).
Now, I am trying to separate requests that need to be proxied by cypress and the ones that don't through a PAC file, supplied as an option on before:browser:launch
but I only managed to have Cypress show a message "This browser was not launched through Cypress. Tests cannot run.".
Do you have any suggestions on how to solve this? I'm banging my head trying to make it workgray-kilobyte-89541
05/25/2023, 10:56 AMpolite-glass-8571
05/25/2023, 10:57 AMgray-kilobyte-89541
05/25/2023, 11:28 AMpolite-glass-8571
05/25/2023, 2:06 PMhttps://cdn.discordapp.com/attachments/1111240184814637149/1111306021797892207/Schermata_2023-05-25_alle_16.51.54.png▾
gray-kilobyte-89541
05/25/2023, 2:57 PMpolite-glass-8571
05/25/2023, 3:00 PMgray-kilobyte-89541
05/25/2023, 4:26 PMpolite-glass-8571
05/25/2023, 4:28 PM#!/bin/bash
brew update
brew install pcre openssl nginx step
DOMAIN=www-local.example.com
SECRET="secret"
PWD=$(pwd)
mkdir -p $PWD/ssl
rm -rf $PWD/ssl/$DOMAIN
export STEPPATH=$PWD/ssl/$DOMAIN
echo $SECRET >> $PWD/ssl/password.txt
step ca init --name=$DOMAIN \
--provisioner="selfsigned" \
--address="127.0.0.1:3000" \
--deployment-type="standalone" \
--dns="$DOMAIN,localhost" \
--password-file="$PWD/ssl/password.txt"
mkdir -p $PWD/ssl/$DOMAIN/keys
step crypto keypair \
$PWD/ssl/$DOMAIN/keys/public_key.pem \
$PWD/ssl/$DOMAIN/keys/private_key.pem \
--kty 'RSA' \
--size 2048 \
--no-password \
--insecure
mkdir -p $PWD/ssl/$DOMAIN/certificate
step ca certificate \
$DOMAIN \
$PWD/ssl/$DOMAIN/certificate/$DOMAIN.crt \
$PWD/ssl/$DOMAIN/certificate/$DOMAIN.key \
--offline \
--san $DOMAIN \
--password-file="$PWD/ssl/password.txt"
cp $PWD/ssl/$DOMAIN/certs/root_ca.crt $PWD/ssl/$DOMAIN.root.crt
mv $PWD/ssl/$DOMAIN/certificate/$DOMAIN.crt $PWD/ssl/$DOMAIN.crt
mv $PWD/ssl/$DOMAIN/certificate/$DOMAIN.key $PWD/ssl/$DOMAIN.key
mv $PWD/ssl/password.txt $PWD/ssl/$DOMAIN.password
rm -rf $PWD/ssl/$DOMAIN
echo "Do you want to install this certificate?"
step certificate install --all $PWD/ssl/$DOMAIN.root.crt