The master is now functionally serving REST and xmlrpc.

...as far as I can tell.  The client, however, is broken,
since it used the old http_pool/ssl_support stuff, which
no longer works.

I have to port puppetd over to using the new ssl stuff,
then I'll at least be able to verify that the master can
still speak xmlrpc.
This commit is contained in:
Luke Kanies 2008-05-05 22:36:59 -05:00
Родитель 6e0d6ddf5e
Коммит 38e2dcf35a
3 изменённых файлов: 9 добавлений и 11 удалений

Просмотреть файл

@ -176,9 +176,13 @@ require 'puppet/file_serving/content'
require 'puppet/file_serving/metadata'
require 'puppet/checksum'
xmlrpc_handlers = [:Status, :FileServer, :Master, :Report, :CA, :Filebucket]
xmlrpc_handlers = [:Status, :FileServer, :Master, :Report, :Filebucket]
rest_handlers = [:file_content, :file_metadata, :certificate, :facts, :catalog, :report, :checksum]
if Puppet[:ca]
xmlrpc_handlers << :CA
end
server = Puppet::Network::Server.new(:handlers => rest_handlers, :xmlrpc_handlers => xmlrpc_handlers)
if Process.uid == 0

Просмотреть файл

@ -91,7 +91,7 @@ class Puppet::Network::HTTP::WEBrick
host = Puppet::SSL::Host.new
host.generate unless host.key
host.generate unless host.certificate
raise Puppet::Error, "Could not retrieve certificate for %s and not running on a valid certificate authority" % host.name unless host.certificate

Просмотреть файл

@ -303,25 +303,19 @@ describe Puppet::Network::HTTP::WEBrick do
it "should use the key from an SSL::Host instance created with the default name" do
Puppet::SSL::Host.expects(:new).returns @host
@host.expects(:key).returns "mykey"
@host.expects(:key).returns @key
@server.setup_ssl[:SSLPrivateKey].should == "mykey"
end
it "should generate a key if no key can be found" do
@host.expects(:key).times(2).returns(nil).then.returns(@key)
it "should generate its files if no certificate can be found" do
@host.expects(:certificate).times(2).returns(nil).then.returns(@cert)
@host.expects(:generate)
@server.setup_ssl
end
it "should fail if no certificate can be found" do
@host.expects(:certificate).returns nil
lambda { @server.setup_ssl }.should raise_error(Puppet::Error)
end
it "should configure the certificate" do
@server.setup_ssl[:SSLCertificate].should == "mycert"
end