# File lib/puppet/network/http/rack/xmlrpc.rb, line 42
42:   def build_client_request(request)
43:     ip = request.ip
44: 
45:     # if we find SSL info in the headers, use them to get a hostname.
46:     # try this with :ssl_client_header, which defaults should work for
47:     # Apache with StdEnvVars.
48:     if dn = request.env[Puppet[:ssl_client_header]] and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/)
49:       node = dn_matchdata[1].to_str
50:       authenticated = (request.env[Puppet[:ssl_client_verify_header]] == 'SUCCESS')
51:     else
52:       begin
53:         node = Resolv.getname(ip)
54:       rescue => detail
55:         Puppet.err "Could not resolve #{ip}: #{detail}"
56:         node = "unknown"
57:       end
58:       authenticated = false
59:     end
60: 
61:     Puppet::Network::ClientRequest.new(node, ip, authenticated)
62:   end