| 1 | # make-ca-bundle.py <out.h>: the system's Mozilla roots as a C string for http_ps3.c |
| 2 | import sys |
| 3 | |
| 4 | pem = open("/etc/ssl/certs/ca-certificates.crt").read() |
| 5 | with open(sys.argv[1], "w") as f: |
| 6 | f.write("// made by CI from /etc/ssl/certs/ca-certificates.crt\nstatic const char ca_bundle_pem[] =\n") |
| 7 | for line in pem.splitlines(): |
| 8 | f.write('"%s\\n"\n' % line.replace('"', '')) |
| 9 | f.write(";\n") |
| 10 | print(pem.count("BEGIN CERTIFICATE"), "root certificates") |