~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ssl_certs/create_ssls.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-25 14:05:34 UTC
  • mto: (3928.1.1 bzr.integration)
  • mto: This revision was merged to the branch mainline in revision 3929.
  • Revision ID: v.ladeuil+lp@free.fr-20071125140534-g4f5b3mrfksjz2gx
Update ssl generated files. Put the branch on the backburner until the ssl python module is fixed (bugs pending).

* bzrlib/tests/ssl_certs/create_ssls.py:
Fix typo. Make the inputs used by _openssl more obvious in calls.

* bzrlib/transport/http/_urllib2_wrappers.py:
(HTTPSConnection.__init__): httplib.py deleted that useful debug
message, reenable it for https.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
    ca_locality='Bazaar',
98
98
    ca_organization='Distributed',
99
99
    ca_section='VCS',
100
 
    ca_name='Master fo certificates',
 
100
    ca_name='Master of certificates',
101
101
    ca_email='cert@no.spam',
102
102
    # Server identity
103
103
    server_country_code='LH',
116
116
    key_path = ssl_certs.build_path('ca.key')
117
117
    rm_f(key_path)
118
118
    _openssl(['genrsa', '-passout', 'stdin', '-des3', '-out', key_path, '4096'],
119
 
             '%(ca_pass)s\n%(ca_pass)s\n' % ssl_params)
 
119
             input='%(ca_pass)s\n%(ca_pass)s\n' % ssl_params)
120
120
 
121
121
 
122
122
def build_ca_certificate():
129
129
              # Will need to be generated again in 10 years -- vila 20071122
130
130
              '-days', '3650',
131
131
              '-key', key_path, '-out', cert_path],
132
 
             '%(ca_pass)s\n'
 
132
             input='%(ca_pass)s\n'
133
133
             '%(ca_country_code)s\n'
134
134
             '%(ca_state)s\n'
135
135
             '%(ca_locality)s\n'
149
149
    key_path = ssl_certs.build_path('server_with_pass.key')
150
150
    rm_f(key_path)
151
151
    _openssl(['genrsa', '-passout', 'stdin', '-des3', '-out', key_path, '4096'],
152
 
             '%(server_pass)s\n%(server_pass)s\n' % ssl_params)
 
152
             input='%(server_pass)s\n%(server_pass)s\n' % ssl_params)
153
153
 
154
154
    key_nopass_path = ssl_certs.build_path('server_without_pass.key')
155
155
    rm_f(key_nopass_path)
156
156
    _openssl(['rsa', '-passin', 'stdin', '-in', key_path,
157
157
              '-out', key_nopass_path,],
158
 
             '%(server_pass)s\n' % ssl_params)
 
158
             input='%(server_pass)s\n' % ssl_params)
159
159
 
160
160
 
161
161
def build_server_signing_request():
166
166
    rm_f(server_csr_path)
167
167
    _openssl(['req', '-passin', 'stdin', '-new', '-key', key_path,
168
168
              '-out', server_csr_path],
169
 
             '%(server_pass)s\n'
 
169
             input='%(server_pass)s\n'
170
170
             '%(server_country_code)s\n'
171
171
             '%(server_state)s\n'
172
172
             '%(server_locality)s\n'
194
194
              '-CA', ca_cert_path, '-CAkey', ca_key_path,
195
195
              '-set_serial', '01',
196
196
              '-out', server_cert_path,],
197
 
             '%(ca_pass)s\n' % ssl_params)
 
197
             input='%(ca_pass)s\n' % ssl_params)
198
198
 
199
199
 
200
200
def build_ssls(name, options, builders):
244
244
        if (Options.keys or Options.certificates or Options.signing_requests
245
245
            or Options.signings):
246
246
            error("--ca and --server can't be used with other options")
 
247
        # Handles --ca before --server so that both can be used in the same run
 
248
        # to generate all the files needed by the https test server
247
249
        if Options.ca:
248
250
            build_ca_key()
249
251
            build_ca_certificate()