Skip to content

Commit

Permalink
Disable SSL usage in MySQL test container
Browse files Browse the repository at this point in the history
By default, testcontainers does not use SSL. This commit
disable SSL usage in the datasource configuration to
prevent `SSLHandshakeException`s.
  • Loading branch information
fmbenhassine committed May 4, 2021
1 parent ad0fd05 commit c3b2e26
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -115,11 +115,12 @@ public void testDateMillisecondPrecision() throws Exception {
static class TestConfiguration {

@Bean
public DataSource dataSource() {
public DataSource dataSource() throws Exception {
MysqlDataSource datasource = new MysqlDataSource();
datasource.setURL(mysql.getJdbcUrl());
datasource.setUser(mysql.getUsername());
datasource.setPassword(mysql.getPassword());
datasource.setUseSSL(false);
return datasource;
}

Expand Down

0 comments on commit c3b2e26

Please sign in to comment.