}
my $cacert_preverified = -e $cacert_file;
-
-if (! -e $privkey_file) {
- my $old_umask = umask(077);
- run_cmd("ofp-pki req $etc/of0 >&2 2>/dev/null");
- chmod(0644, $req_file) or die "$req_file: chmod: $!\n";
- umask($old_umask);
-}
-
my ($req, $req_fingerprint);
-if (! -e $cert_file) {
- open(REQ, '<', $req_file) or die "$req_file: open: $!\n";
- $req = join('', <REQ>);
- close(REQ);
- $req_fingerprint = sha1_hex($req);
-}
my %options;
db_go();
}
},
+ sub {
+ return 'skip' if !ssl_enabled();
+
+ if (! -e $privkey_file) {
+ my $old_umask = umask(077);
+ run_cmd("ofp-pki req $etc/of0 >&2 2>/dev/null");
+ chmod(0644, $req_file) or die "$req_file: chmod: $!\n";
+ umask($old_umask);
+ }
+
+ if (! -e $cert_file) {
+ open(REQ, '<', $req_file) or die "$req_file: open: $!\n";
+ $req = join('', <REQ>);
+ close(REQ);
+ $req_fingerprint = sha1_hex($req);
+ }
+ return 'skip';
+ },
sub {
return 'skip' if !ssl_enabled();
return 'skip' if -e $cacert_file && -e $cert_file;
echo "$CACERT: CA certificate missing" >&2
fi
echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ if test "$MODE" = discovery; then
+ echo "You may also delete or rename $PRIVKEY to disable SSL requirement" >&2
+ fi
exit 1
fi
SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT"