接着搞
现在搭建的通过http能正常同步android源码。
然后大约需要做
1,配置https模式用以规避curl: (22) The requested URL returned error: 404 Not Found
Server does not provide clone.bundle; ignoring.问题;
2,给开发板MX6库的那个配置manifest,可以通过repo来正常运行;
3,MX6库进行整体模拟开发测试,上线;
4,android库自动同步最新源码;
1,配置gerrit使用http协议
1)配置apache使用https
安装ssl模块
安装完后会创建默认SSL证书,路径位于
- [root@Android ~]# yum install mod_ssl
重启apache,此时,支持http及http访问。
- [root@Android ~]# ls /etc/pki/tls/
- cert.pem certs misc openssl.cnf private
- [root@Android ~]#
此时查看https证书信息,都是默认生成的。。。。
2)手动创建证书
①生成服务器私钥
②用私钥生成证书请求文件csr
- senrsl@senrsl-T540p:~$ cd test/
- senrsl@senrsl-T540p:~/test$ mkdir ssl
- senrsl@senrsl-T540p:~/test$ cd ssl/
- senrsl@senrsl-T540p:~/test/ssl$ openssl genrsa -out gerrit.key 1024
- Generating RSA private key, 1024 bit long modulus
- ...............++++++
- .++++++
- e is 65537 (0x10001)
- senrsl@senrsl-T540p:~/test/ssl$ ll
密码往后直接回车
- senrsl@senrsl-T540p:~/test/ssl$ openssl req -new -key gerrit.key -out gerrit.csrYou are about to be asked to enter information that will be incorporated
- into your certificate request.
- What you are about to enter is what is called a Distinguished Name or a DN.
- There are quite a few fields but you can leave some blank
- For some fields there will be a default value,
- If you enter '.', the field will be left blank.
- -----
- Country Name (2 letter code) [AU]:CN
- State or Province Name (full name) [Some-State]:Bejing
- Locality Name (eg, city) []:Beijing
- Organization Name (eg, company) [Internet Widgits Pty Ltd]:SENRSLr
- Organizational Unit Name (eg, section) []:SENRSL
- Common Name (e.g. server FQDN or YOUR name) []:gerrit.senrsl.com
- Email Address []:senRsl@126.com
- Please enter the following 'extra' attributes
- to be sent with your certificate request
- A challenge password []:
- An optional company name []:
- senrsl@senrsl-T540p:~/test/ssl$ ll
③生成数字签名crt文件
- senrsl@senrsl-T540p:~/test/ssl$ openssl x509 -days 3650 -req -in gerrit.csr -signkey gerrit.key -out gerrt.crt
- Signature ok
- subject=/C=CN/ST=Bejing/L=Beijing/O=SENRSLr/OU=SENRSL/CN=gerrit.senrsl.com/emailAddress=senRsl@126.com
- Getting Private key
- senrsl@senrsl-T540p:~/test/ssl$
3)apache部署自定义证书
创建文件夹
把gerrit.key和gerrit.crt上传到这个目录
- [root@Android gerrit]# pwd
- /etc/pki/tls/gerrit
然后修改证书地址
重启httpd
- # Server Certificate:
- # Point SSLCertificateFile at a PEM encoded certificate. If
- # the certificate is encrypted, then you will be prompted for a
- # pass phrase. Note that a kill -HUP will prompt again. A new
- # certificate can be generated using the genkey(1) command.
- #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
- SSLCertificateFile /etc/pki/tls/gerrit/gerrt.crt
- # Server Private Key:
- # If the key is not combined with the certificate, use this
- # directive to point at the key file. Keep in mind that if
- # you've both a RSA and a DSA private key you can configure
- # both in parallel (to also allow the use of DSA ciphers, etc.)
- #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
- SSLCertificateKeyFile /etc/pki/tls/gerrit/gerrit.key
访问http正常
访问https,查看证书
4)配置gerrit使用ssl
gerrit没配置原来也可以用https了。。。。
5)下载测试
①用自定义证书
- curl: (60) SSL certificate problem: self signed certificate
- More details here: http://curl.haxx.se/docs/sslcerts.html
- curl performs SSL certificate verification by default, using a "bundle"
- of Certificate Authority (CA) public keys (CA certs). If the default
- bundle file isn't adequate, you can specify an alternate file
- using the --cacert option.
- If this HTTPS server uses a certificate signed by a CA represented in
- the bundle, the certificate verification probably failed due to a
- problem with the certificate (it might be expired, or the name might
- not match the domain name in the URL).
- If you'd like to turn off curl's verification of the certificate, use
- the -k (or --insecure) option.
- fatal: unable to access 'https://10.1.11.145/gerrit/AOSP/platform/manifest/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
- fatal: unable to access 'https://10.1.11.145/gerrit/AOSP/platform/manifest/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
- fatal: cannot obtain manifest https://10.1.11.145/gerrit/AOSP/platform/manifest
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u htps://10.1.11.145/gerrit/AOSP/platform/manifest
- Get https://10.1.11.145/gerrit/AOSP/git-repo
- fatal: unable to access 'https://10.1.11.145/gerrit/AOSP/git-repo/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
没法下载。。。。
网页打开,发现多级目录时404,
重新初始化下然后就成这样了。。。。
- Internal Server Error
- The server encountered an internal error or misconfiguration and was unable to complete your request.
- Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
- More information about this error may be available in the server error log.
- Apache/2.2.15 (CentOS) Server at 10.1.11.145 Port 443
这么弄太危险了,还是新建个gerrit搞https比较好。。。。
哎,上面那个问题
上面那条命令影响了
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ git config --global http.sslverify false
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u https://10.1.11.145/gerrit/AOSP/platform/manifest
~.gitconfig和~.repo_gitconfig.json
哎,真无语了。。。。
加了这个一直报那一串自定义证书问题。。。。
但是不会当成错误了。。。。
解决了一个问题,又出现一个更头疼的问题。。。。
算了,就这样吧。。。。。。。。
6)自定义证书信任
①浏览器信任自定义证书
②ubuntu信任自定义证书
脚本如是
- senrsl@senrsl-T540p:/usr/share/ca-certificates$ sudo mkdir extra
- [sudo] password for senrsl:
- senrsl@senrsl-T540p:/usr/share/ca-certificates$ sudo cp ~/test/ssl/gerr
- gerrit.csr gerrit.key gerrt.crt
- senrsl@senrsl-T540p:/usr/share/ca-certificates$ sudo cp ~/test/ssl/gerrt.crt /usr/share/ca-certificates/extra/gerrit.crt
- [sudo] password for senrsl:
- senrsl@senrsl-T540p:/usr/share/ca-certificates$ sudo dpkg-reconfigure ca-certificates
- 正在处理用于 ca-certificates (20141019ubuntu0.14.04.1) 的触发器 ...
- Updating certificates in /etc/ssl/certs... WARNING: Skipping duplicate certificate Go_Daddy_Class_2_CA.pem
- WARNING: Skipping duplicate certificate Go_Daddy_Class_2_CA.pem
- 1 added, 0 removed; done.
- Running hooks in /etc/ca-certificates/update.d....
- Adding debian:gerrit.pem
- done.
- done.
- senrsl@senrsl-T540p:/usr/share/ca-certificates$ ls /etc/ssl/certs/ge*
- /etc/ssl/certs/gerrit.pem
- senrsl@senrsl-T540p:/usr/share/ca-certificates$
2,开发板源码manifest编写
2016年09月02日18:14:13
做好离职准备
--
senRsl
2015年12月31日17:36:16
2015年12月31日17:36:16
没有评论 :
发表评论