Bitbucket SSL update

my SSL certificate expired in Bitbukect. How I update new certificate with it?

1 answer

1 accepted

0 votes
Accepted answer

Dear Thusitha,

What version of Bitbucket instance do you have this request for ?

Regards,

Victor.

Version 4.11 under tomcat and I already got .crt and cer.pem files from godady. I need to know how to remove current key and how to install new key to it?

SSL Certificate in TOMCAT through godaddy.com

 

1. Import the gd_bundle certificate using the following command: (Replace the file location with the location you placed your new certificates from GoDaddy)
keytool -import -alias intermed -keystore tomcat.keystore -trustcacerts -file gd_bundle.crt

2. Import your certificate signed by GoDaddy by typing the following command: (Replace myFQDN.crt with the file name and location of the new GoDaddy certificate)
keytool -import -alias tomcat -keystore tomcat.keystore -trustcacerts -file myFQDN.crt

3. change the connector from the server.xml file.
< Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
keystoreFile="path of tomcat.keystore file" keystorePass="your password" / >

After you save changes to server.xml, restart Tomcat to begin using your SSL.

 

You might want to carefully read through Securing Bitbucket Server with Tomcat using SSL.

If you need specific information, feel free to ask.

Regards,

Victor.

Hi Thanks for rely. I got following error after restart with new settings

uses an unsupported protocol.

ERR_SSL_VERSION_OR_CIPHER_MISMATCH

DETAILS

Unsupported protocolThe client and server don't support a common SSL protocol version or cipher suite.


I run following commands in certificate file location

keytool -import -alias intermed -keystore mesp2018.jks -trustcacerts -file 2018gd_bundle-g2-g1.crt

keytool -import -alias tomcat -keystore mesp2018.jks -trustcacerts -file 2018.crt

iserver xml as follows
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
keystoreFile="/etc/pki/tls/SSL/mesp2018.jks" keystorePass="********"
clientAuth="false" sslProtocol="TLS" />

Please assist.

Dear Thusitha,

Do you have this error logged in you instance of Bitbucket server log ?

Regards.

that keystoreFile name extention to be  .keystore or .jks ? my old file extention is jks thats why i'm created jks.
log as follows.

2018-04-01 03:39:48,133 INFO [spring-startup] c.a.s.i.server.BuildInfoLogger Starting Bitbucket 4.11.0 (a01338f built on Fri Nov 04 06:23:00 GMT 2016)
2018-04-01 03:39:48,139 INFO [spring-startup] c.a.s.i.server.BuildInfoLogger JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.8.0_111-b14
2018-04-01 03:39:48,166 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /opt/BITBUCKET
2018-04-01 03:39:56,235 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /opt/BITBUCKET/shared
2018-04-01 03:40:29,092 INFO [spring-startup] c.a.s.i.t.ResourceThrottleStrategyProvider [scm-hosting] This machine's total available memory cannot safely support a maximum of 24 tickets. Reducing maximum tickets to 9 instead
2018-04-01 03:40:32,707 INFO [spring-startup] c.a.s.i.hook.DefaultHookService Hook callback socket listening on 127.0.0.1:39067
2018-04-01 03:40:49,184 WARN [ThreadPoolAsyncTaskExecutor::Thread 36] c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2018-04-01 03:40:50,154 WARN [ThreadPoolAsyncTaskExecutor::Thread 49] c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2018-04-01 03:40:54,358 WARN [ThreadPoolAsyncTaskExecutor::Thread 53] c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2018-04-01 03:40:54,690 WARN [ThreadPoolAsyncTaskExecutor::Thread 25] c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2018-04-01 03:40:54,869 WARN [ThreadPoolAsyncTaskExecutor::Thread 48] c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2018-04-01 03:40:58,351 INFO [ThreadPoolAsyncTaskExecutor::Thread 17] c.a.s.i.s.g.t.DefaultTranscodeServer Callback socket listening at 127.0.0.1:38485
2018-04-01 03:41:17,336 WARN [spring-startup] c.a.s.i.p.s.OsgiBundledPathScanner Cannot scan directory /com/atlassian/oauth/shared/servlet/ in bundle com.atlassian.oauth.atlassian-oauth-service-provider-plugin; it does not exist
2018-04-01 03:41:19,922 INFO [spring-startup] c.a.b.s.j.c.i.HealthCheckRunner New health check registered: SearchIndexCheck
2018-04-01 03:41:19,922 INFO [spring-startup] c.a.b.s.i.c.DefaultClusterJobManager Registering job for ElasticsearchSynchronizeJob
2018-04-01 03:41:19,925 INFO [spring-startup] c.a.b.s.i.i.e.IndexEventQueueProcessor Event queue processor has been started
2018-04-01 03:41:20,227 INFO [spring-startup] c.a.b.s.i.c.DefaultClusterJobManager Registering job for StartupChecksJob
2018-04-01 03:41:20,246 INFO [spring-startup] c.a.b.s.j.c.i.HealthCheckRunner New health check registered: AuthenticationCheck
2018-04-01 03:41:20,552 INFO [spring-startup] c.a.b.internal.ssh.server.SshServer Starting SSH server on port 7999...
2018-04-01 03:41:20,622 INFO [spring-startup] c.a.b.internal.ssh.server.SshServer Started SSH server successfully.
2018-04-01 03:41:22,469 INFO [spring-startup] c.a.s.internal.scm.PluginScmService Bitbucket is using /usr/bin/git version 1.8.3.1
2018-04-01 03:41:22,769 INFO [spring-startup] c.a.s.i.hazelcast.HazelcastLifecycle Updating Hazelcast instance capabilities
2018-04-01 03:41:29,957 INFO [Caesium-1-1] c.a.b.s.j.c.i.HealthCheckRunner Running up to 2 search health checks
2018-04-01 03:41:30,247 INFO [Caesium-1-3] c.a.b.s.i.i.jobs.StartupChecksJob Attempting provisioning in startup job
2018-04-01 03:41:30,250 INFO [Caesium-1-3] c.a.b.s.i.i.jobs.StartupChecksJob Running startup jobs for search
2018-04-01 03:41:30,449 INFO [I/O dispatcher 3] c.a.b.s.s.t.DefaultElasticsearchConnectionTester Connected to Elasticsearch version 2.3.1
2018-04-01 03:41:30,764 INFO [Caesium-1-1] c.a.b.s.j.c.i.HealthCheckRunner Health checks will run again after PT5M

keystoreFile="<path/to/tomcat.keystore"
keystorePass="***"
keyAlias="insert private key alias here"/>

what is private key alias?

An alias is a unique string to identify the key entry when you add an entity to the keystore. 

#keytool -import -alias tomcat -keystore mesp2018.jks -trustcacerts -file 2018.crt

tomcat in this case is your private key alias.

 

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticationProvider' defined in file [/opt/atlassian/bitbucket/4.11.0/atlassian-bitbucket/WEB-INF/classes/com/atlassian/stash/internal/spring/security/PluginAuthenticationProvider.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'authenticationService' defined in URL [jar:file:/opt/atlassian/bitbucket/4.11.0/atlassian-bitbucket/WEB-INF/lib/bitbucket-service-impl-4.11.0.jar!/com/atlassian/stash/internal/auth/DefaultAuthenticationService.class]: Unsatisfied dependency expressed through constructor parameter 2: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticationService' defined in URL [jar:file:/opt/atlassian/bitbucket/4.11.0/atlassian-bitbucket/WEB-INF/lib/bitbucket-service-impl-4.11.0.jar!/com/atlassian/stash/internal/auth/DefaultAuthenticationService.class]: Unsatisfied dependency expressed through constructor parameter 2: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 5 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticationService' defined in URL [jar:file:/opt/atlassian/bitbucket/4.11.0/atlassian-bitbucket/WEB-INF/lib/bitbucket-service-impl-4.11.0.jar!/com/atlassian/stash/internal/auth/DefaultAuthenticationService.class]: Unsatisfied dependency expressed through constructor parameter 2: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'
... 6 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginAccessor' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 5 common frames omitted
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:164) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 5 common frames omitted
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'pluginConfiguration': 'Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix'
at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:216) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:94) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:81) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:51) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:87) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:120) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:242) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:161) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 5 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.expression.BeanExpressionContextAccessor.read(BeanExpressionContextAccessor.java:42) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:211) ~[spring-expression-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 12 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugin.main.PluginsConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 14 common frames omitted
Caused by: com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /opt/BITBUCKET/plugins/.osgi-cache/felix
at com.atlassian.plugin.osgi.container.impl.DefaultOsgiPersistentCache.validate(DefaultOsgiPersistentCache.java:81) ~[atlassian-plugins-osgi-4.2.4.jar:na]
at com.atlassian.plugin.main.PluginsConfigurationBuilder$InternalPluginsConfiguration.<init>(PluginsConfigurationBuilder.java:295) ~[atlassian-plugins-main-4.2.4.jar:na]
at com.atlassian.plugin.main.PluginsConfigurationBuilder.build(PluginsConfigurationBuilder.java:262) ~[atlassian-plugins-main-4.2.4.jar:na]
at com.atlassian.stash.internal.plugin.PluginConfigurationFactory.create(PluginConfigurationFactory.java:64) ~[bitbucket-platform-4.11.0.jar:na]
... 14 common frames omitted
Caused by: java.io.IOException: Unable to delete file: /opt/BITBUCKET/plugins/.osgi-cache/felix/felix-cache/bundle21/version0.0/revision.location
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
... 17 common frames omitted

A fatal error has occurred

The following problem occurred, which prevents Atlassian Bitbucket from starting:

  • SpringMVC dispatcher [springMvc] could not be started

Can i get a link to the log file, i will need to examine the complete log to understand the issue.

Hello

Has your instance started up now ?

Regards.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

434 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you