Example code: Don't create rs_error on failing context creation.
[radsecproxy.git] / radsecproxy.conf-example
1 # Master config file, must be in /etc/radsecproxy or specified with -c option
2 #       All possible config options are listed below
3
4 # First you may define any global options, these are:
5 #
6 # You can optionally specify addresses and ports to listen on
7 # Multiple statements can be used for multiple ports/addresses
8 #ListenUDP              *:1814
9 #listenUDP              localhost
10 #ListenTCP              [2001:700:1:7:215:f2ff:fe35:307d]:1812
11 #listenTLS              10.10.10.10:2084
12 #ListenTLS              [2001:700:1:7:215:f2ff:fe35:307d]:2084
13 #ListenDTLS             [2001:700:1:7:215:f2ff:fe35:307d]:2084
14
15 # To specify a certain address/port for UDP/TLS requests you can use e.g.
16 #SourceUDP              127.0.0.1:33000
17 #SourceTCP              *:33000
18 #SourceTLS              *:33001
19 #SourceDTLS             *:33001
20 # Optional log level. 3 is default, 1 is less, 5 is more
21 #LogLevel               3
22 # Optional LogDestination, else stderr used for logging
23 # Logging to file
24 #LogDestination         file:///tmp/rp.log
25 # Or logging with Syslog. LOG_DAEMON used if facility not specified
26 # The supported facilities are LOG_DAEMON, LOG_MAIL, LOG_USER and
27 # LOG_LOCAL0, ..., LOG_LOCAL7
28 #LogDestination         x-syslog:///
29 #LogDestination         x-syslog:///log_local2
30
31 # There is an option for doing some simple loop prevention.  Note that
32 # the LoopPrevention directive can be used in server blocks too,
33 # overriding what's set here in the basic settings.
34 #LoopPrevention         on
35 # Add TTL attribute with value 20 if not present (prevents endless loops)
36 #addTTL 20
37
38 # If we have TLS clients or servers we must define at least one tls block.
39 # You can name them whatever you like and then reference them by name when
40 # specifying clients or servers later. There are however three special names
41 # "default", "defaultclient" and "defaultserver". If no name is defined for
42 # a client, the "defaultclient" block will be used if it exists, if not the
43 # "default" will be used. For a server, "defaultserver" followed by "default"
44 # will be checked.
45 #
46 # The simplest configuration you can do is:
47 tls default {
48     # You must specify at least one of CACertificateFile or CACertificatePath
49     # for TLS to work. We always verify peer certificate (client and server)
50     # CACertificateFile    /etc/cacerts/CA.pem
51     CACertificatePath   /etc/cacerts
52
53     # You must specify the below for TLS, we always present our certificate
54     CertificateFile     /etc/hostcertkey/host.example.com.pem
55     CertificateKeyFile  /etc/hostcertkey/host.example.com.key.pem
56     # Optionally specify password if key is encrypted (not very secure)
57     CertificateKeyPassword      "follow the white rabbit"
58     # Optionally enable CRL checking
59     # CRLCheck on
60     # Optionally specify how long CAs and CRLs are cached, default forever
61     # CacheExpiry 3600
62     # Optionally require that peer certs have one of the specified policyOIDs
63     # policyoid     1.2.3 # this option can be used multiple times
64     # policyoid     1.3.4
65 }
66
67 # If you want one cert for all clients and another for all servers, use
68 # defaultclient and defaultserver instead of default. If we wanted some
69 # particular server to use something else you could specify a block
70 # "tls myserver" and then reference that for that server. If you always
71 # name the tls block in the client/server config you don't need a default
72
73 # Now we configure clients, servers and realms. Note that these and
74 # also the lines above may be in any order, except that a realm
75 # can only be configured to use a server that is previously configured.
76
77 # A realm can be a literal domain name, * which matches all, or a
78 # regexp. A regexp is specified by the character prefix /
79 # For regexp we do case insensitive matching of the entire username string.
80 # The matching of realms is done in the order they are specified, using the
81 # first match found. Some examples are
82 # "@example\.com$", "\.com$", ".*" and "^[a-z].*@example\.com$".
83 # To treat local users separately you might try first specifying "@"
84 # and after that "*".
85
86 # Configure a rewrite block if you want to add/remove/modify attributes
87 # rewrite example {
88 #       # Remove NAS-Port.
89 #       removeAttribute 5
90 #       # Remove vendor attribute 100.
91 #       removeVendorAttribute 99:100
92 #       # Called-Station-Id = "123456"
93 #       addAttribute 30:123456
94 #       # Vendor-99-Attr-101 = 0x0f
95 #       addVendorAttribute 99:101:%0f
96 #       # Change users @local to @example.com.
97 #       modifyAttribute 1:/^(.*)@local$/\1@example.com/
98 # }
99
100 client 2001:db8::1 {
101         type    tls
102         secret  verysecret
103 # we could specify tls here, e.g.
104 #       tls myclient
105 # in order to use tls parameters named myclient. We don't, so we will
106 # use "tls defaultclient" if defined, or look for "tls default" as a
107 # last resort
108 }
109 client 127.0.0.1 {
110         type    udp
111         secret  secret
112 #       Might do rewriting of incoming messages using rewrite block example
113 #       rewriteIn example
114 #       Can also do rewriting of outgoing messages
115 #       rewriteOut example      
116 }
117 client 127.0.0.1 {
118         type    tcp
119         secret  secret
120 }
121 client radius.example.com {
122         type tls
123 # secret is optional for TLS
124 }
125 client radius.example.com {
126         type dtls
127 # secret is optional for DTLS
128 }
129
130 server 127.0.0.1 {
131         type    UDP
132         secret  secret
133 #       Might do rewriting of incoming messages using rewrite block example
134 #       rewriteIn example
135 #       Can also do rewriting of outgoing messages
136 #       rewriteOut example      
137 #       Might override loop prevention here too:
138 #       LoopPrevention off
139 }
140 realm   eduroam.cc {
141         server  127.0.0.1
142 # If also want to use this server for accounting, specify
143 #       accountingServer 127.0.0.1
144 }
145
146 server 2001:db8::1 {
147         type    TLS
148         port    2283
149 # secret is optional for TLS
150 # we could specify tls here, e.g.
151 #       tls myserver
152 # in order to use tls parameters named myserver. We don't, so we will
153 # use "tls defaultserver" if defined, or look for "tls default" as a
154 # last resort
155 }
156 server radius.example.com {
157         type    tls
158         secret  verysecret
159         StatusServer on
160 # statusserver is optional, can be on or off. Off is default
161 }
162 #server radius.example.com {
163 #       type    dtls
164 #       secret  verysecret
165 #       StatusServer on
166 ## statusserver is optional, can be on or off. Off is default
167 #}
168
169 # Equivalent to example.com
170 realm /@example\.com$ {
171         server 2001:db8::1
172 }
173 # One can define a realm without servers, the proxy will then reject
174 # and requests matching this. Optionally one can specify ReplyMessage
175 # attribute to be included in the reject message. One can also use
176 # AccountingResponse option to specify that the proxy should send such.
177 realm /\.com$ {
178 }
179 realm /^anonymous$ {
180         replymessage "No Access"
181 #       AccountingResponse On
182 }
183 # The realm below is equivalent to /.*
184 realm * {
185         server radius.example.com
186 }
187 # If you don't have a default server you probably want to
188 # reject all unknowns. Optionally you can also include a message
189 #realm * {
190 #        replymessage "User unknown"
191 #}