Unable to upload cookbooks to chef server using knife

Hi,

We are unable to upload a cookbook to chef-server. There is connectivity
between the knife VM and chef server and the pem authentication works fine.
Checked with creating a node and client, those actions get reflected in the
knife node. with knife client list and knife node list.
However when we try to upload a cookbook with knife , we get ehe below error

/usr/lib/ruby/1.9.1/net/http.rb:763:in initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) from /usr/lib/ruby/1.9.1/net/http.rb:763:inopen’
from /usr/lib/ruby/1.9.1/net/http.rb:763:in `block in connect’

we tried setting the host name in chef server and knife both in /etc/hosts/
set the proxy in knife.rb (incase it was a proxy issue) but we still are not
able to upload

Any pointers are appriciated.