Skip to content

Commit 6601512

Browse files
committed
README to add certs
Closes #1567 [skip ci]
1 parent a2ec4bc commit 6601512

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Talk to us at https://www.selenium.dev/support/
5050
* [Building the images](#building-the-images)
5151
* [Waiting for the Grid to be ready](#waiting-for-the-grid-to-be-ready)
5252
* [Debugging](#debugging)
53+
* [Install cerificates for Chromium based browsers](#install-cerificates-for-Chromium-based-browsers)
5354
* [Troubleshooting](#troubleshooting)
5455

5556

@@ -822,6 +823,52 @@ Like this, the script will poll until the Grid is ready, and then your tests wil
822823
823824
___
824825
826+
## Install cerificates for Chromium based browsers
827+
828+
If you need to install custom certificates, CA, intermediate CA, client certificates (for exmample enterprise internal CA)
829+
you can use the different utils come from libnss3-tools.
830+
Chromium based browser uses nssdb as certificate store
831+
Create new nssdb:
832+
```bash
833+
certutil -d sql:$HOME/.pki/nssdb -N
834+
diemol marked this conversation as resolved.
835+
```
836+
For example, to trust a root CA certificate for issuing SSL server certificates, use
837+
```bash
838+
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n <certificate nickname> -i <certificate filename>
839+
```
840+
To import an intermediate CA certificate, use
841+
```bash
842+
certutil -d sql:$HOME/.pki/nssdb -A -t ",," -n <certificate nickname> -i <certificate filename>
843+
```
844+
You can find more information [here](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md)
845+
Usage example:
846+
If your company has internal CA you can create your own dockerimage from selenium node image.
847+
You can then install all required internal certificates in your Dockerfile like this:
848+
```bash
849+
FROM selenium/node-edge:latest
850+
USER root
851+
COPY certs/ /etc/certs # copy over the certificate file
852+
853+
#=========
854+
# libnss3-tools
855+
# Network Security Service tools
856+
# Manage certificates in nssdb (certutil, pk12util, modutil, shlibsign, signtool, ssltap)
857+
#=========
858+
RUN apt-get update -qqy \
859+
&& apt-get -qqy install \
860+
libnss3-tools \
861+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
862+
863+
RUN mkdir -p -m755 /home/seluser/.pki/nssdb \ #create nssdb folder
864+
&& certutil -d sql:/home/seluser/.pki/nssdb -N --empty-password \ # create new db without password
865+
&& certutil -d sql:/home/seluser/.pki/nssdb -A -t "C,," -n companyca -i /etc/certs/companeca.pem \ #trust company CA
866+
&& pk12util -d sql:/home/seluser/.pki/nssdb -i client_cert.p12 -W password_of_clent_cert # client certificate install
867+
```
868+
This way the certificates will be installed and the node will start automatically as before.
869+
870+
___
871+
825872
## Debugging
826873
827874
This project uses [x11vnc](https://github.com/LibVNC/x11vnc) as VNC server to allow users inspect what is happening

0 commit comments

Comments
 (0)