Skip to content

Commit

Permalink
Add SSL checking function in windows OVS script
Browse files Browse the repository at this point in the history
Windows OVS needs SSL files to start service.

Add new funtion in Install-OVS.ps1 to check files exist and install
SSL library if files don't exist.

issue #4027

Signed-off-by: Shuyang Xin <gavinx@vmware.com>
Co-authored-by: wenyingd <wenyingd@vmware.com>
  • Loading branch information
XinShuYang and wenyingd committed Jul 22, 2022
1 parent 0620323 commit 0c74166
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions hack/windows/Install-OVS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ function InstallOVS() {
SetEnvVar "Path" $env:Path
}

function InstallDependency() {
# Check if SSL library has been installed
$pathEntries = $env:Path.Split(";") | ForEach-Object {
if ((Test-Path "$_/ssleay32.dll" -PathType Leaf) -and (Test-Path "$_/libeay32.dll" -PathType Leaf)) {
Log "Found existing SSL library."
return
}
}
$SSLZip = "openssl-1.0.2u-x64_86-win64.zip"
$SSLDownloadURL = "https://indy.fulgan.com/SSL/$SSLZip"
curl.exe -LO $SSLDownloadURL
If (!$?) {
Log "Download SSL files failed, URL: $SSLDownloadURL"
Log "You should install ssleay32.dll and libeay32.dll to OVSInstallDir\usr\sbin\ manually"
exit 1
}
Expand-Archive $SSLZip -DestinationPath openssl
cp -Force openssl/*.dll $OVSInstallDir\usr\sbin\
rm -Recurse -Force openssl
rm $SSLZip
}

function ConfigOVS() {
# Create ovsdb config file
$OVS_DB_SCHEMA_PATH = "$OVSInstallDir\usr\share\openvswitch\vswitch.ovsschema"
Expand Down Expand Up @@ -231,6 +253,8 @@ DownloadOVS

InstallOVS

InstallDependency

ConfigOVS

Log "OVS Installation Complete!"

0 comments on commit 0c74166

Please sign in to comment.