forked from vmware-archive/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition when host is stopping
.. and ServerX509TrustManager is starting. Change-Id: Id649d76f318ccf4720be430a28ef6d486f22dfbd Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/10330 Compute-Verified: jenkins <[email protected]> Closures-Verified: jenkins <[email protected]> Upgrade-Verified: jenkins <[email protected]> Bellevue-Verified: jenkins <[email protected]> CS-Verified: jenkins <[email protected]> Reviewed-by: Lazarin Lazarov <[email protected]>
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ target | |
*~ | ||
\#*# | ||
build | ||
.vscode/ | ||
!tools/build | ||
lib/extjs/extjs/ | ||
.DS_Store | ||
|
31 changes: 31 additions & 0 deletions
31
common-test/src/test/java/com/vmware/admiral/common/util/TrustManagerResetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2017 VMware, Inc. All Rights Reserved. | ||
* | ||
* This product is licensed to you under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this product except in compliance with the License. | ||
* | ||
* This product may include a number of subcomponents with separate copyright notices | ||
* and license terms. Your use of these subcomponents is subject to the terms and | ||
* conditions of the subcomponent's license, as noted in the LICENSE file. | ||
*/ | ||
|
||
package com.vmware.admiral.common.util; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
import com.vmware.xenon.common.Utils; | ||
|
||
public final class TrustManagerResetter { | ||
private TrustManagerResetter() { | ||
} | ||
|
||
public static void reset() { | ||
try { | ||
Field field = ServerX509TrustManager.class.getDeclaredField("INSTANCE"); | ||
field.setAccessible(true); | ||
field.set(null, null); | ||
} catch (Exception e) { | ||
Utils.logWarning("Cannot reset ServerX509TrustManager"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters