Skip to content

Commit 779dad1

Browse files
authored
Merge pull request #407 from oneclick/reverse-ssl-link
Reverse the junction/link to "ssl" dir
2 parents 16aa941 + 883bcb5 commit 779dad1

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

recipes/installer-inno/rubyinstaller.iss.erb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,15 @@ Root: <%= regroot %>; Subkey: Software\Classes\<%= rubyname %>File\shell\open\co
133133
; So use Innosetup to add described permissions and icacls to disable unwanted inheritance.
134134
[Dirs]
135135
Name: {app}; Permissions: creatorowner-full users-readexec admins-full
136-
Name: "{app}/<%= package.rubyver2 =~ /^3\.[23]$/ ? "bin/etc" : "lib/ruby/#{ package.rubylibver }/etc" %>"
137136

138137
[Run]
139138
; Set permissions on install directories
140139
Filename: "icacls.exe"; Parameters: """{app}"" /inheritancelevel:r "; WorkingDir: "{app}"; StatusMsg: "Changing install Directory Permissions"; Flags: runhidden
141140
<% if with_msys %>
142141
Filename: "icacls.exe"; Parameters: """{app}\<%= package.msysdir %>\tmp"" /inheritancelevel:r /grant *S-1-5-32-545:(CI)(WD,AD,WEA,WA) /grant *S-1-3-0:(OI)(CI)(IO)(F) /grant *S-1-5-32-544:(OI)(CI)(F) /grant *S-1-5-32-545:(NP)(RX) "; WorkingDir: "{app}"; StatusMsg: "Changing MSYS2 /tmp Directory Permissions"; Flags: runhidden; Components: msys2
143142
<% end %>
144-
; Add link to SSL CA certs so that OpenSSL finds them based on the libssl.dll location
145-
Filename: "{cmd}"; Parameters: "/c mklink /j <%= package.rubyver2 =~ /^3\.[23]$/ ? "bin" : "lib\\ruby\\#{package.rubylibver}" %>\etc\ssl ssl"; WorkingDir: "{app}"; StatusMsg: "Add link to SSL CA certs"; Flags: runhidden
143+
; Add link to SSL CA certs. The destination depends on the libssl.dll location.
144+
Filename: "{cmd}"; Parameters: "/c mklink /j ssl <%= package.rubyver2 =~ /^3\.[23]$/ ? "bin" : "lib\\ruby\\#{package.rubylibver}" %>\etc\ssl"; WorkingDir: "{app}"; StatusMsg: "Add link to SSL CA certs"; Flags: runhidden
146145

147146
[Icons]
148147
Name: {autoprograms}\{#InstallerName}\{cm:InteractiveRubyTitle}; Filename: {app}\bin\irb.<%= package.rubyver2 < '3.1' ? "cmd" : "bat" %>; IconFilename: {app}\bin\ruby.exe

recipes/sandbox/10-define-variables.rake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ self.thisdir = "recipes/sandbox"
33
self.sandboxdir = "#{thisdir}/#{package.packagenameverarch}"
44
self.import_files = {}
55
self.sandboxfiles = []
6+
self.ssl_dir = case
7+
when package.rubyver2 < "3.2"
8+
"ssl"
9+
when package.rubyver2 < "3.4"
10+
"bin/etc/ssl"
11+
else
12+
"lib/ruby/#{package.rubylibver}/etc/ssl"
13+
end

recipes/sandbox/20-define-import-files.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ self.import_files.merge!({
1010
"resources/files/setrbvars.cmd" => "bin/setrbvars.cmd",
1111
"resources/files/operating_system.rb" => "lib/ruby/#{package.rubylibver}/rubygems/defaults/operating_system.rb",
1212
"resources/icons/ruby-doc.ico" => "share/doc/ruby/html/images/ruby-doc.ico",
13-
"resources/ssl/cacert.pem" => "ssl/cert.pem",
14-
"resources/ssl/README-SSL.md" => "ssl/README-SSL.md",
15-
"resources/ssl/c_rehash.rb" => "ssl/certs/c_rehash.rb",
13+
"resources/ssl/cacert.pem" => "#{ssl_dir}/cert.pem",
14+
"resources/ssl/README-SSL.md" => "#{ssl_dir}/README-SSL.md",
15+
"resources/ssl/c_rehash.rb" => "#{ssl_dir}/certs/c_rehash.rb",
1616
"#{thisdir}/LICENSE.txt" => "LICENSE.txt",
1717
})

resources/ssl/README-SSL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ New releases of the RubyInstaller2 update the CA list to the latest version at t
99
`cert.pem` shouldn't be modified manually, because it will be overwritten by updates of RubyInstaller2.
1010
Instead add certificates as described below.
1111

12+
Location of the bundled certificates
13+
------------------------------------
14+
The storage directory of the bundled certificates varies depending on the ruby version.
15+
Due to a junction created by the installer the certs can always be found in `<install-path>/ssl`.
16+
When using the 7z archive the link is not present, but the certificates are stored here:
17+
18+
* ruby <= 3.1.x : `ssl`
19+
* ruby >= 3.2.x and <= 3.3.x : `bin/etc/ssl`
20+
* ruby >= 3.4.x : `lib/ruby/<ruby-version>/etc/ssl`
21+
1222
Use of an alternative Ruby CA list
1323
-----------------------------
1424

0 commit comments

Comments
 (0)