osc commond error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

osc commond error

Aaron Yung
Hi,

When I am  fascinated with Open Build Service,I would like to setup my  own OBS just for fun.

I did the job following README.SETUP Guideline  in obs-api rpm step by step ,And Now I can access my OBS very well.

But I think I did the ssl certificate job OK by the following commond
------------------------------------------------------------------------------------------------------
 Generate an ssl certificate via following commands:

  mkdir /srv/obs/certs
  openssl genrsa -out /srv/obs/certs/server.key 1024
  openssl req -new -key /srv/obs/certs/server.key \
          -out /srv/obs/certs/server.csr
  openssl x509 -req -days 365 -in /srv/obs/certs/server.csr \
          -signkey /srv/obs/certs/server.key -out /srv/obs/certs/server.crt
  cat /srv/obs/certs/server.key /srv/obs/certs/server.crt \
      > /srv/obs/certs/server.pem
-----------------------------------------------------------------------------------------------------

But I also got a problem, my osc commond didn't work.
This is error message :
==========================================================================


Traceback (most recent call last):
  File "/usr/bin/osc", line 22, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 53, in run
    return prg.main()
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 310, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 333, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 449, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1179, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 375, in do_list
    for prj in meta_get_project_list(apiurl, opts.deleted):
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2940, in meta_get_project_list
    f = http_GET(u)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2853, in http_GET
    def http_GET(*args, **kwargs):    return http_request('GET', *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2841, in http_request
    fd = urllib2.urlopen(req, data=data)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 209, in https_open
    h.request(req.get_method(), selector, req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 946, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 987, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 940, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 803, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 755, in send
    self.connect()
  File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 244, in connect
    verify_certificate(self)
  File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 310, in verify_certificate
    if tc.is_trusted(): # ok, same cert as the stored one
  File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 48, in is_trusted
    cert = X509.load_cert(self.file)
  File "/usr/lib/python2.7/site-packages/M2Crypto/X509.py", line 611, in load_cert
    return load_cert_bio(bio)
  File "/usr/lib/python2.7/site-packages/M2Crypto/X509.py", line 639, in load_cert_bio
    raise X509Error(Err.get_error())
M2Crypto.X509.X509Error: 3074913984:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: CERTIFICATE
=================================================================================

Did I missed something important? I have no idea about it .

Anybody can give me a hand ? So many many thanks to U  

Go OBS
Reply | Threaded
Open this post in threaded view
|

Re: osc commond error

Adrian Schröter
Am Donnerstag, 19. Juli 2012, 22:43:00 schrieb stefenyung:

> Hi,
>
> When I am  fascinated with Open Build Service,I would like to setup my  own
> OBS just for fun.
>
> I did the job following README.SETUP Guideline  in obs-api rpm step by step
> ,And Now I can access my OBS very well.
>
> But I think I did the ssl certificate job OK by the following commond
> ------------------------------------------------------------------------------------------------------
>  Generate an ssl certificate via following commands:
>
>   mkdir /srv/obs/certs
>   openssl genrsa -out /srv/obs/certs/server.key 1024
>   openssl req -new -key /srv/obs/certs/server.key \
>           -out /srv/obs/certs/server.csr
>   openssl x509 -req -days 365 -in /srv/obs/certs/server.csr \
>           -signkey /srv/obs/certs/server.key -out /srv/obs/certs/server.crt
>   cat /srv/obs/certs/server.key /srv/obs/certs/server.crt \
>       > /srv/obs/certs/server.pem
> -----------------------------------------------------------------------------------------------------
>
> But I also got a problem, my osc commond didn't work.
> This is error message :
> ==========================================================================
>
>
> Traceback (most recent call last):
>   File "/usr/bin/osc", line 22, in <module>
>     r = babysitter.run(osccli)
>   File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 53, in run
>     return prg.main()
>   File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 310, in main
>     return self.cmd(args)
>   File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 333, in cmd
>     retval = self.onecmd(argv)
>   File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 449, in onecmd
>     return self._dispatch_cmd(handler, argv)
>   File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1179, in
> _dispatch_cmd
>     return handler(argv[0], opts, *args)
>   File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 375, in
> do_list
>     for prj in meta_get_project_list(apiurl, opts.deleted):
>   File "/usr/lib/python2.7/site-packages/osc/core.py", line 2940, in
> meta_get_project_list
>     f = http_GET(u)
>   File "/usr/lib/python2.7/site-packages/osc/core.py", line 2853, in
> http_GET
>     def http_GET(*args, **kwargs):    return http_request('GET', *args,
> **kwargs)
>   File "/usr/lib/python2.7/site-packages/osc/core.py", line 2841, in
> http_request
>     fd = urllib2.urlopen(req, data=data)
>   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
>     return _opener.open(url, data, timeout)
>   File "/usr/lib/python2.7/urllib2.py", line 391, in open
>     response = self._open(req, data)
>   File "/usr/lib/python2.7/urllib2.py", line 409, in _open
>     '_open', req)
>   File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain
>     result = func(*args)
>   File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 209, in
> https_open
>     h.request(req.get_method(), selector, req.data, headers)
>   File "/usr/lib/python2.7/httplib.py", line 946, in request
>     self._send_request(method, url, body, headers)
>   File "/usr/lib/python2.7/httplib.py", line 987, in _send_request
>     self.endheaders(body)
>   File "/usr/lib/python2.7/httplib.py", line 940, in endheaders
>     self._send_output(message_body)
>   File "/usr/lib/python2.7/httplib.py", line 803, in _send_output
>     self.send(msg)
>   File "/usr/lib/python2.7/httplib.py", line 755, in send
>     self.connect()
>   File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 244, in
> connect
>     verify_certificate(self)
>   File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 310, in
> verify_certificate
>     if tc.is_trusted(): # ok, same cert as the stored one
>   File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 48, in
> is_trusted
>     cert = X509.load_cert(self.file)
>   File "/usr/lib/python2.7/site-packages/M2Crypto/X509.py", line 611, in
> load_cert
>     return load_cert_bio(bio)
>   File "/usr/lib/python2.7/site-packages/M2Crypto/X509.py", line 639, in
> load_cert_bio
>     raise X509Error(Err.get_error())
> M2Crypto.X509.X509Error: 3074913984:error:0906D06C:PEM
> routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: CERTIFICATE
> =================================================================================
>
> Did I missed something important? I have no idea about it .
>
> Anybody can give me a hand ? So many many thanks to U  


that may be more a python-mcrypt or openssl problem. Do you use an openSUSE distro?

--
Adrian Schroeter
SUSE Linux Products GmbH
email: [hidden email]

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: osc commond error

Aaron Yung
Yeah, I have used  openSUSE:11.4  for a long time. Maybe I should spend some time researching the openssl certificate's stuff.

Thanks for  your advice.
Go OBS
Reply | Threaded
Open this post in threaded view
|

Re: osc commond error

Aaron Yung
In reply to this post by Adrian Schröter
Is there any way  to forbidden using the ssl certificate in osc config or somewhere? Actually it made no sense for me just in my local area network
Go OBS