File: disable-external

package info (click to toggle)
pgsql-http 1.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 276 kB
  • sloc: ansic: 1,211; sql: 483; makefile: 22; sh: 9
file content (90 lines) | stat: -rw-r--r-- 1,736 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Disable all external test URLs

--- a/sql/http.sql
+++ b/sql/http.sql
@@ -2,6 +2,7 @@ CREATE EXTENSION http;
 SET http.server_host = 'http://localhost:9080';
 set http.timeout_msec = 10000;
 SELECT http_set_curlopt('CURLOPT_TIMEOUT', '10');
+/*
 -- if local server not up use global one
 DO language plpgsql $$
 BEGIN
@@ -12,6 +13,7 @@ BEGIN
   END;
 END;
 $$;
+*/
 
 -- Status code
 SELECT status
@@ -176,6 +178,7 @@ SELECT status FROM http_get(current_sett
 -- SET to bogus file
 SET http.CURLOPT_CAINFO = '/path/to/somebundle.crt';
 
+/*
 -- should fail
 DO $$
 BEGIN
@@ -185,12 +188,15 @@ EXCEPTION
         RAISE WARNING 'Invalid cert file';
 END;
 $$;
+*/
 
 -- set to ignore cert
 SET http.CURLOPT_SSL_VERIFYPEER = '0';
 
+/*
 -- should pass
 SELECT status FROM http_get('https://postgis.net');
+*/
 
 SHOW http.CURLOPT_CAINFO;
 
--- a/expected/http.out
+++ b/expected/http.out
@@ -7,6 +7,7 @@ SELECT http_set_curlopt('CURLOPT_TIMEOUT
  t
 (1 row)
 
+/*
 -- if local server not up use global one
 DO language plpgsql $$
 BEGIN
@@ -17,6 +18,7 @@ BEGIN
   END;
 END;
 $$;
+*/
 -- Status code
 SELECT status
 FROM http_get(current_setting('http.server_host') || '/status/202');
@@ -268,6 +270,7 @@ SELECT status FROM http_get(current_sett
 
 -- SET to bogus file
 SET http.CURLOPT_CAINFO = '/path/to/somebundle.crt';
+/*
 -- should fail
 DO $$
 BEGIN
@@ -277,16 +280,13 @@ EXCEPTION
         RAISE WARNING 'Invalid cert file';
 END;
 $$;
-WARNING:  Invalid cert file
+*/
 -- set to ignore cert
 SET http.CURLOPT_SSL_VERIFYPEER = '0';
+/*
 -- should pass
 SELECT status FROM http_get('https://postgis.net');
- status 
---------
-    200
-(1 row)
-
+*/
 SHOW http.CURLOPT_CAINFO;
    http.curlopt_cainfo   
 -------------------------