@@ -84,7 +84,7 @@ sslfiles: $(SSLFILES) $(SSLDIRS)
84
84
85
85
# Root CA is self-signed.
86
86
ssl/root_ca.crt : ssl/root_ca.key conf/root_ca.config
87
- openssl req -new -x509 -config conf/root_ca.config -days 10000 -key $< -out $@
87
+ $( OPENSSL ) req -new -x509 -config conf/root_ca.config -days 10000 -key $< -out $@
88
88
89
89
#
90
90
# Special-case keys
@@ -94,20 +94,20 @@ ssl/root_ca.crt: ssl/root_ca.key conf/root_ca.config
94
94
95
95
# Password-protected version of server-cn-only.key
96
96
ssl/server-password.key : ssl/server-cn-only.key
97
- openssl rsa -aes256 -in $< -out $@ -passout ' pass:secret1'
97
+ $( OPENSSL ) rsa -aes256 -in $< -out $@ -passout ' pass:secret1'
98
98
99
99
# DER-encoded version of client.key
100
100
ssl/client-der.key : ssl/client.key
101
- openssl rsa -in $< -outform DER -out $@
101
+ $( OPENSSL ) rsa -in $< -outform DER -out $@
102
102
103
103
# Convert client.key to encrypted PEM (X.509 text) and DER (X.509 ASN.1)
104
104
# formats to test libpq's support for the sslpassword= option.
105
105
ssl/client-encrypted-pem.key : ssl/client.key
106
- openssl rsa -in $< -outform PEM -aes128 -passout ' pass:dUmmyP^#+' -out $@
106
+ $( OPENSSL ) rsa -in $< -outform PEM -aes128 -passout ' pass:dUmmyP^#+' -out $@
107
107
# TODO Explicitly choosing -aes128 generates a key unusable to PostgreSQL with
108
108
# OpenSSL 3.0.0, so fall back on the default for now.
109
109
ssl/client-encrypted-der.key : ssl/client.key
110
- openssl rsa -in $< -outform DER -passout ' pass:dUmmyP^#+' -out $@
110
+ $( OPENSSL ) rsa -in $< -outform DER -passout ' pass:dUmmyP^#+' -out $@
111
111
112
112
#
113
113
# Combined files
@@ -145,7 +145,7 @@ $(COMBINATIONS):
145
145
#
146
146
147
147
$(STANDARD_KEYS ) :
148
- openssl genrsa -out $@ 2048
148
+ $( OPENSSL ) genrsa -out $@ 2048
149
149
chmod 0600 $@
150
150
151
151
#
@@ -165,18 +165,18 @@ client_ca_state_files := ssl/client_ca-certindex ssl/client_ca-certindex.attr ss
165
165
# parallel processes, so we must mark the entire Makefile .NOTPARALLEL.
166
166
.NOTPARALLEL :
167
167
$(CA_CERTS ) : ssl/% .crt: ssl/% .csr conf/% .config conf/cas.config ssl/root_ca.crt | ssl/new_certs_dir $(root_ca_state_files )
168
- openssl ca -batch -config conf/cas.config -name root_ca -notext -in $< -out $@
168
+ $( OPENSSL ) ca -batch -config conf/cas.config -name root_ca -notext -in $< -out $@
169
169
170
170
$(SERVER_CERTS ) : ssl/% .crt: ssl/% .csr conf/% .config conf/cas.config ssl/server_ca.crt | ssl/new_certs_dir $(server_ca_state_files )
171
- openssl ca -batch -config conf/cas.config -name server_ca -notext -in $< -out $@
171
+ $( OPENSSL ) ca -batch -config conf/cas.config -name server_ca -notext -in $< -out $@
172
172
173
173
$(CLIENT_CERTS ) : ssl/% .crt: ssl/% .csr conf/% .config conf/cas.config ssl/client_ca.crt | ssl/new_certs_dir $(client_ca_state_files )
174
- openssl ca -batch -config conf/cas.config -name client_ca -notext -in $< -out $@
174
+ $( OPENSSL ) ca -batch -config conf/cas.config -name client_ca -notext -in $< -out $@
175
175
176
176
# The CSRs don't need to persist after a build.
177
177
.INTERMEDIATE : $(CERTIFICATES:%=ssl/%.csr )
178
178
ssl/% .csr : ssl/% .key conf/% .config
179
- openssl req -new -utf8 -key $< -out $@ -config conf/$* .config
179
+ $( OPENSSL ) req -new -utf8 -key $< -out $@ -config conf/$* .config
180
180
181
181
#
182
182
# CA State
@@ -210,16 +210,16 @@ ssl/%.srl:
210
210
#
211
211
212
212
ssl/root.crl : ssl/root_ca.crt | $(root_ca_state_files )
213
- openssl ca -config conf/cas.config -name root_ca -gencrl -out $@
213
+ $( OPENSSL ) ca -config conf/cas.config -name root_ca -gencrl -out $@
214
214
215
215
ssl/server.crl : ssl/server-revoked.crt ssl/server_ca.crt | $(server_ca_state_files )
216
- openssl ca -config conf/cas.config -name server_ca -revoke $<
217
- openssl ca -config conf/cas.config -name server_ca -gencrl -out $@
216
+ $( OPENSSL ) ca -config conf/cas.config -name server_ca -revoke $<
217
+ $( OPENSSL ) ca -config conf/cas.config -name server_ca -gencrl -out $@
218
218
219
219
ssl/client.crl : ssl/client-revoked.crt ssl/client-revoked-utf8.crt ssl/client_ca.crt | $(client_ca_state_files )
220
- openssl ca -config conf/cas.config -name client_ca -revoke ssl/client-revoked.crt
221
- openssl ca -config conf/cas.config -name client_ca -revoke ssl/client-revoked-utf8.crt
222
- openssl ca -config conf/cas.config -name client_ca -gencrl -out $@
220
+ $( OPENSSL ) ca -config conf/cas.config -name client_ca -revoke ssl/client-revoked.crt
221
+ $( OPENSSL ) ca -config conf/cas.config -name client_ca -revoke ssl/client-revoked-utf8.crt
222
+ $( OPENSSL ) ca -config conf/cas.config -name client_ca -gencrl -out $@
223
223
224
224
#
225
225
# CRL hash directories
@@ -230,7 +230,7 @@ ssl/root+client-crldir: ssl/client.crl ssl/root.crl
230
230
ssl/server-crldir : ssl/server.crl
231
231
ssl/client-crldir : ssl/client.crl
232
232
233
- crlhashfile = $(shell openssl crl -hash -noout -in $(1 ) ) .r0
233
+ crlhashfile = $(shell $( OPENSSL ) crl -hash -noout -in $(1 ) ) .r0
234
234
235
235
ssl/% -crldir :
236
236
mkdir -p $@
0 commit comments