大网数据广告活动
服务器运维问答

Creating an SSL keystore for bitbucket server

· 52CE 我爱测

I'm getting quite frustrated trying to setup https access to our bitbucket server. Following bitbuckets documentation isn't that helpful. So far I have the executed the following commands Firtly, I created a certificate signing r…

问题原文

原帖链接 · ScaryAardvark · CC BY-SA 4.0

I'm getting quite frustrated trying to setup https access to our bitbucket server.

Following bitbuckets documentation isn't that helpful.

So far I have the executed the following commands

Firtly, I created a certificate signing request and sent that to my certificate provider and they have sent me a certificate.

openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr

At this point I have 3 files, domain.key, domain.csr and a ssl certificate provided to mey, domain.cer

I then tried to create a keystore with the following command

keytool -genkey -alias tomcat -keyalg RSA -keystore ssl-keystore

I was prompted for a keystore password and I provided one.

I then tried to import the certificate provided to me.

keytool -import -alias tomcat -file domain.cer -keystore ssl-keystore

and got the following error.

keytool error: java.lang.Exception: Public keys in reply and keystore don't match

I'm a complete ssl newbie and am relying on following website instructions and am at a loss now what to do.

已采纳解答

原帖链接 · vx3r · CC BY-SA 4.0

Assuming you have 2 files below domain.key and domain.cer (private key and signed certificate) you can change tho format to pkcs12 like this

openssl pkcs12 -export -in domain.cer -inkey domain.key -name domain -out domain.p12

and then import in jkl with

keytool -importkeystore -deststorepass changeme1 -destkeystore domain.jks -srcstorepass changeme2 -srckeystore domain.p12 -srcstoretype pkcs12

where changeme1 is the new keystore password and changeme2 is the password specified during the export (first step)

now you can use domain.jks

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。