- Notifications
You must be signed in to change notification settings - Fork5
Commit397831e
committed
At long last I put together a patch to support 4 client SSL negotiation
modes (and replace the requiressl boolean). The four options were firstspelled out by Magnus Hagander <mha@sollentuna.net> on 2000-08-23 in emailto pgsql-hackers, archived here:http://archives.postgresql.org/pgsql-hackers/2000-08/msg00639.phpMy original less-flexible patch and the ensuing thread are archived at:http://dbforums.com/t623845.htmlAttached is a new patch, including documentation.To sum up, there's a new client parameter "sslmode" and environmentvariable "PGSSLMODE", with these options:sslmode description------- -----------disable Unencrypted non-SSL onlyallow Negotiate, prefer non-SSLprefer Negotiate, prefer SSL (default)require Require SSLThe only change to the server is a new pg_hba.conf line type,"hostnossl", for specifying connections that are not allowed to use SSL(for example, to prevent servers on a local network from accidentallyusing SSL and wasting cycles). Thus the 3 pg_hba.conf line types are:pg_hba.conf line types----------------------host applies to either SSL or regular connectionshostssl applies only to SSL connectionshostnossl applies only to regular connectionsThese client and server options, the postgresql.conf ssl = false option,and finally the possibility of compiling with no SSL support at all,make quite a range of combinations to test. I threw together a testscript to try many of them out. It's in a separate tarball with itsconfig files, a patch to psql so it'll announce SSL connections even inabsence of a tty, and the test output. The test is especially informativewhen run on the same tty the postmaster was started on, so the FATAL:errors during negotiation are interleaved with the psql client output.I saw Tom write that new submissions for 7.4 have to be in before midnightlocal time, and since I'm on the east coast in the US, this just makes itin before the bell. :)Jon Jensen1 parent5f2499d commit397831e
File tree
6 files changed
+286
-36
lines changed- doc/src/sgml
- src
- backend/libpq
- interfaces/libpq
6 files changed
+286
-36
lines changedLines changed: 19 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
| 86 | + | |
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
| 91 | + | |
91 | 92 |
| |
92 | 93 |
| |
| 94 | + | |
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
| |||
136 | 138 |
| |
137 | 139 |
| |
138 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
139 | 152 |
| |
140 | 153 |
| |
141 | 154 |
| |
| |||
196 | 209 |
| |
197 | 210 |
| |
198 | 211 |
| |
199 |
| - | |
200 |
| - | |
| 212 | + | |
| 213 | + | |
201 | 214 |
| |
202 | 215 |
| |
203 | 216 |
| |
| |||
224 | 237 |
| |
225 | 238 |
| |
226 | 239 |
| |
227 |
| - | |
228 |
| - | |
| 240 | + | |
| 241 | + | |
229 | 242 |
| |
230 | 243 |
| |
231 | 244 |
| |
|
Lines changed: 58 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
206 | 206 |
| |
207 | 207 |
| |
208 | 208 |
| |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
209 | 233 |
| |
210 | 234 |
| |
211 | 235 |
| |
212 | 236 |
| |
213 |
| - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
214 | 243 |
| |
215 | 244 |
| |
216 |
| - | |
| 245 | + | |
| 246 | + | |
217 | 247 |
| |
218 | 248 |
| |
219 | 249 |
| |
| |||
3140 | 3170 |
| |
3141 | 3171 |
| |
3142 | 3172 |
| |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
3143 | 3194 |
| |
3144 | 3195 |
| |
3145 | 3196 |
| |
3146 | 3197 |
| |
3147 | 3198 |
| |
3148 | 3199 |
| |
3149 | 3200 |
| |
3150 |
| - | |
3151 |
| - | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
3152 | 3205 |
| |
3153 | 3206 |
| |
3154 | 3207 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
439 | 439 |
| |
440 | 440 |
| |
441 | 441 |
| |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
442 | 448 |
| |
443 | 449 |
| |
444 |
| - | |
445 |
| - | |
| 450 | + | |
| 451 | + | |
446 | 452 |
| |
447 | 453 |
| |
448 | 454 |
| |
|
Lines changed: 13 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
595 | 595 |
| |
596 | 596 |
| |
597 | 597 |
| |
598 |
| - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
599 | 601 |
| |
600 | 602 |
| |
601 |
| - | |
| 603 | + | |
602 | 604 |
| |
603 | 605 |
| |
604 | 606 |
| |
| |||
614 | 616 |
| |
615 | 617 |
| |
616 | 618 |
| |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
617 | 627 |
| |
618 | 628 |
| |
619 | 629 |
| |
|
0 commit comments
Comments
(0)