File: find_ssl_root_certs

package info (click to toggle)
epic5 3.0.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: ansic: 75,810; makefile: 648; ruby: 227; python: 215; sh: 78; perl: 13
file content (66 lines) | stat: -rw-r--r-- 2,197 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
if (word(2 $loadinfo()) != [pf]) { load -pf $word(1 $loadinfo()); return; };

#
# Here's the plan...
#
# Rather than have configure auto-detect where your root CA file is,
# and have that path hardcoded into the binary, we're going to do 
# that search at startup.  Then, if you want to do it some other way,
# you can!  How about that...
#
# If anyone has a better way to do this, please let me know!
#
#	I found this at http://bradconte.com/using-load_verify_locations
#
#	Debian, Ubuntu, Arch, SuSE
#	NetBSD (security/mozilla-rootcerts)
#		/etc/ssl/certs/
#	Debian, Ubuntu, Arch: (update-ca-certificates)
#		/etc/ssl/certs/ca-certificates.crt
#	Red Hat 5+, Fedora, Centos
#		/etc/pki/tls/certs/ca-bundle.crt
#	Red Hat 4
#		/usr/share/ssl/certs/ca-bundle.crt
#	FreeBSD (security/ca-root-nss)
#		/usr/local/share/certs/ca-root-nss.crt
#	FreeBSD (pre-2008 security/ca-root)
#		/usr/local/share/certs/ca-root.crt
#	OpenBSD
#		/etc/ssl/cert.pem
#	Mac OS X
#		/System/Library/OpenSSL/certs/cert.pem
#
alias setup_ssl_root_cert_file
{
	@ ssl_cert_locations[0] = [~/.sslca.bundle];
	@ ssl_cert_locations[1] = [/etc/ssl/certs/ca-certificates.crt];
	@ ssl_cert_locations[2] = [/etc/pki/tls/certs/ca-bundle.crt];
	@ ssl_cert_locations[3] = [/usr/share/ssl/certs/ca-bundle.crt];
	@ ssl_cert_locations[4] = [/usr/local/share/certs/ca-root-nss.crt];
	@ ssl_cert_locations[5] = [/usr/local/share/certs/ca-root.crt];
	@ ssl_cert_locations[6] = [/etc/ssl/cert.pem];
	@ ssl_cert_locations[7] = [/System/Library/OpenSSL/certs/cert.pem];

	@ ssl_cert_locations[8] = [/etc/ssl/ca.bundle];
	@ ssl_cert_locations[9] = [/usr/local/etc/ssl/ca.bundle];
	@ ssl_cert_locations[10] = [/opt/etc/ssl/ca.bundle];
	@ ssl_cert_locations[11] = [/opt/share/certs/ca.bundle];
	@ ssl_cert_locations[12] = [/usr/share/certs/ca-root-nss.crt];

	@ ssl_cert_locations[13] = [/etc/ssl/certs/];
	
	foreach ssl_cert_locations i 
	{
		echo Checking $ssl_cert_locations[$i];
		if (fexist($ssl_cert_locations[$i]) == 1)
		{
			set SSL_ROOT_CERTS_LOCATION $ssl_cert_locations[$i];
			return;
		};
	};
	xecho -b I couldn't find a root certificate file.  You'll have to /SET SSL_ROOT_CERT_FILE manually.;
};

setup_ssl_root_cert_file

#hop'2k15