Skip to content

Commit 63496db

Browse files
authored
Remove P2P TLS (experimental) feature (#7942)
1 parent 792c656 commit 63496db

File tree

68 files changed

+20
-4208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+20
-4208
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Breaking Changes
66
- Removed Retesteth rpc service and commands [#7833](https://github.com/hyperledger/besu/pull/7783)
7+
- TLS for P2P (early access feature) has been removed [#7942](https://github.com/hyperledger/besu/pull/7942)
78
- With the upgrade of the Prometheus Java Metrics library, there are the following changes:
89
- Gauge names are not allowed to end with `total`, therefore the metric `besu_blockchain_difficulty_total` is losing the `_total` suffix
910
- The `_created` timestamps are not returned by default, you can set the env var `BESU_OPTS="-Dio.prometheus.exporter.includeCreatedTimestamps=true"` to enable them

acceptance-tests/dsl/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ dependencies {
1818
implementation project(':ethereum:permissioning')
1919
implementation project(':ethereum:rlp')
2020
implementation project(':metrics:core')
21-
implementation project(':pki')
22-
implementation project(path: ':pki', configuration: 'testArtifacts')
2321
implementation project(':plugin-api')
2422
implementation project(':plugins:rocksdb')
2523
implementation project(':services:kvstore')

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.hyperledger.besu.ethereum.core.Util;
3333
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
3434
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
35-
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
3635
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
3736
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
3837
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
@@ -96,7 +95,6 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
9695
private final Properties portsProperties = new Properties();
9796
private final Boolean p2pEnabled;
9897
private final int p2pPort;
99-
private final Optional<TLSConfiguration> tlsConfiguration;
10098
private final NetworkingConfiguration networkingConfiguration;
10199
private final boolean revertReasonEnabled;
102100

@@ -156,7 +154,6 @@ public BesuNode(
156154
final GenesisConfigurationProvider genesisConfigProvider,
157155
final boolean p2pEnabled,
158156
final int p2pPort,
159-
final Optional<TLSConfiguration> tlsConfiguration,
160157
final NetworkingConfiguration networkingConfiguration,
161158
final boolean discoveryEnabled,
162159
final boolean bootnodeEligible,
@@ -207,7 +204,6 @@ public BesuNode(
207204
this.network = network;
208205
this.p2pEnabled = p2pEnabled;
209206
this.p2pPort = p2pPort;
210-
this.tlsConfiguration = tlsConfiguration;
211207
this.networkingConfiguration = networkingConfiguration;
212208
this.discoveryEnabled = discoveryEnabled;
213209
this.bootnodeEligible = bootnodeEligible;
@@ -659,10 +655,6 @@ public boolean isP2pEnabled() {
659655
return p2pEnabled;
660656
}
661657

662-
public Optional<TLSConfiguration> getTLSConfiguration() {
663-
return tlsConfiguration;
664-
}
665-
666658
public NetworkingConfiguration getNetworkingConfiguration() {
667659
return networkingConfiguration;
668660
}

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.hyperledger.besu.cli.options.storage.DataStorageOptions;
2323
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
2424
import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration;
25-
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
2625
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
2726
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
2827
import org.hyperledger.besu.plugin.services.metrics.MetricCategory;
@@ -365,26 +364,6 @@ private List<String> commandlineArgs(final BesuNode node, final Path dataDir) {
365364
final List<String> networkConfigParams =
366365
NetworkingOptions.fromConfig(node.getNetworkingConfiguration()).getCLIOptions();
367366
params.addAll(networkConfigParams);
368-
if (node.getTLSConfiguration().isPresent()) {
369-
final TLSConfiguration config = node.getTLSConfiguration().get();
370-
params.add("--Xp2p-tls-enabled");
371-
params.add("--Xp2p-tls-keystore-type");
372-
params.add(config.getKeyStoreType());
373-
params.add("--Xp2p-tls-keystore-file");
374-
params.add(config.getKeyStorePath().toAbsolutePath().toString());
375-
params.add("--Xp2p-tls-keystore-password-file");
376-
params.add(config.getKeyStorePasswordPath().toAbsolutePath().toString());
377-
params.add("--Xp2p-tls-crl-file");
378-
params.add(config.getCrlPath().toAbsolutePath().toString());
379-
if (null != config.getTrustStoreType()) {
380-
params.add("--Xp2p-tls-truststore-type");
381-
params.add(config.getTrustStoreType());
382-
params.add("--Xp2p-tls-truststore-file");
383-
params.add(config.getTrustStorePath().toAbsolutePath().toString());
384-
params.add("--Xp2p-tls-truststore-password-file");
385-
params.add(config.getTrustStorePasswordPath().toAbsolutePath().toString());
386-
}
387-
}
388367
}
389368

390369
if (node.isRevertReasonEnabled()) {

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ public void startNode(final BesuNode node) {
197197
.permissioningService(permissioningService)
198198
.metricsConfiguration(node.getMetricsConfiguration())
199199
.p2pEnabled(node.isP2pEnabled())
200-
.p2pTLSConfiguration(node.getTLSConfiguration())
201200
.graphQLConfiguration(GraphQLConfiguration.createDefault())
202201
.staticNodes(node.getStaticNodes().stream().map(EnodeURLImpl::fromString).toList())
203202
.besuPluginContext(besuPluginContext)

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfiguration.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
2626
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
2727
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
28-
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
2928
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
3029
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
3130
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
@@ -56,7 +55,6 @@ public class BesuNodeConfiguration {
5655
private final GenesisConfigurationProvider genesisConfigProvider;
5756
private final boolean p2pEnabled;
5857
private final int p2pPort;
59-
private final Optional<TLSConfiguration> tlsConfiguration;
6058
private final NetworkingConfiguration networkingConfiguration;
6159
private final boolean discoveryEnabled;
6260
private final boolean bootnodeEligible;
@@ -95,7 +93,6 @@ public class BesuNodeConfiguration {
9593
final GenesisConfigurationProvider genesisConfigProvider,
9694
final boolean p2pEnabled,
9795
final int p2pPort,
98-
final Optional<TLSConfiguration> tlsConfiguration,
9996
final NetworkingConfiguration networkingConfiguration,
10097
final boolean discoveryEnabled,
10198
final boolean bootnodeEligible,
@@ -131,7 +128,6 @@ public class BesuNodeConfiguration {
131128
this.genesisConfigProvider = genesisConfigProvider;
132129
this.p2pEnabled = p2pEnabled;
133130
this.p2pPort = p2pPort;
134-
this.tlsConfiguration = tlsConfiguration;
135131
this.networkingConfiguration = networkingConfiguration;
136132
this.discoveryEnabled = discoveryEnabled;
137133
this.bootnodeEligible = bootnodeEligible;
@@ -226,10 +222,6 @@ public int getP2pPort() {
226222
return p2pPort;
227223
}
228224

229-
public Optional<TLSConfiguration> getTLSConfiguration() {
230-
return tlsConfiguration;
231-
}
232-
233225
public NetworkingConfiguration getNetworkingConfiguration() {
234226
return networkingConfiguration;
235227
}

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfigurationBuilder.java

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
import static com.google.common.base.Preconditions.checkNotNull;
1818
import static java.util.Collections.singletonList;
19-
import static org.hyperledger.besu.pki.keystore.KeyStoreWrapper.KEYSTORE_TYPE_JKS;
20-
import static org.hyperledger.besu.pki.keystore.KeyStoreWrapper.KEYSTORE_TYPE_PKCS11;
21-
import static org.hyperledger.besu.pki.keystore.KeyStoreWrapper.KEYSTORE_TYPE_PKCS12;
2219

2320
import org.hyperledger.besu.cli.config.NetworkName;
2421
import org.hyperledger.besu.crypto.KeyPair;
@@ -31,20 +28,17 @@
3128
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.JwtAlgorithm;
3229
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
3330
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
34-
import org.hyperledger.besu.ethereum.api.tls.FileBasedPasswordProvider;
3531
import org.hyperledger.besu.ethereum.core.AddressHelpers;
3632
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
3733
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
3834
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
3935
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
4036
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
4137
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
42-
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
4338
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
4439
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
4540
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
4641
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider;
47-
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.pki.PKCS11Utils;
4842

4943
import java.io.File;
5044
import java.net.URISyntaxException;
@@ -84,7 +78,6 @@ public class BesuNodeConfigurationBuilder {
8478
private GenesisConfigurationProvider genesisConfigProvider = ignore -> Optional.empty();
8579
private Boolean p2pEnabled = true;
8680
private int p2pPort = 0;
87-
private Optional<TLSConfiguration> tlsConfiguration = Optional.empty();
8881
private final NetworkingConfiguration networkingConfiguration = NetworkingConfiguration.create();
8982
private boolean discoveryEnabled = true;
9083
private boolean bootnodeEligible = true;
@@ -381,64 +374,6 @@ public BesuNodeConfigurationBuilder p2pPort(final int p2pPort) {
381374
return this;
382375
}
383376

384-
private static Path toPath(final String path) throws Exception {
385-
return Path.of(BesuNodeConfigurationBuilder.class.getResource(path).toURI());
386-
}
387-
388-
public BesuNodeConfigurationBuilder p2pTLSEnabled(final String name, final String type) {
389-
final TLSConfiguration.Builder builder = TLSConfiguration.Builder.tlsConfiguration();
390-
try {
391-
final String nsspin = "/pki-certs/%s/nsspin.txt";
392-
final String truststore = "/pki-certs/%s/truststore.p12";
393-
final String crl = "/pki-certs/crl/crl.pem";
394-
switch (type) {
395-
case KEYSTORE_TYPE_JKS:
396-
builder
397-
.withKeyStoreType(type)
398-
.withKeyStorePath(toPath(String.format("/pki-certs/%s/%<s.jks", name)))
399-
.withKeyStorePasswordSupplier(
400-
new FileBasedPasswordProvider(toPath(String.format(nsspin, name))))
401-
.withKeyStorePasswordPath(toPath(String.format(nsspin, name)))
402-
.withTrustStoreType(KEYSTORE_TYPE_PKCS12)
403-
.withTrustStorePath(toPath(String.format(truststore, name)))
404-
.withTrustStorePasswordSupplier(
405-
new FileBasedPasswordProvider(toPath(String.format(nsspin, name))))
406-
.withTrustStorePasswordPath(toPath(String.format(nsspin, name)))
407-
.withCrlPath(toPath(crl));
408-
break;
409-
case KEYSTORE_TYPE_PKCS12:
410-
builder
411-
.withKeyStoreType(type)
412-
.withKeyStorePath(toPath(String.format("/pki-certs/%s/%<s.p12", name)))
413-
.withKeyStorePasswordSupplier(
414-
new FileBasedPasswordProvider(toPath(String.format(nsspin, name))))
415-
.withKeyStorePasswordPath(toPath(String.format(nsspin, name)))
416-
.withTrustStoreType(KEYSTORE_TYPE_PKCS12)
417-
.withTrustStorePath(toPath(String.format(truststore, name)))
418-
.withTrustStorePasswordSupplier(
419-
new FileBasedPasswordProvider(toPath(String.format(nsspin, name))))
420-
.withTrustStorePasswordPath(toPath(String.format(nsspin, name)))
421-
.withCrlPath(toPath(crl));
422-
break;
423-
case KEYSTORE_TYPE_PKCS11:
424-
builder
425-
.withKeyStoreType(type)
426-
.withKeyStorePath(
427-
PKCS11Utils.initNSSConfigFile(
428-
toPath(String.format("/pki-certs/%s/nss.cfg", name))))
429-
.withKeyStorePasswordSupplier(
430-
new FileBasedPasswordProvider(toPath(String.format(nsspin, name))))
431-
.withKeyStorePasswordPath(toPath(String.format(nsspin, name)))
432-
.withCrlPath(toPath(crl));
433-
break;
434-
}
435-
} catch (final Exception e) {
436-
throw new RuntimeException(e);
437-
}
438-
this.tlsConfiguration = Optional.of(builder.build());
439-
return this;
440-
}
441-
442377
public BesuNodeConfigurationBuilder discoveryEnabled(final boolean discoveryEnabled) {
443378
this.discoveryEnabled = discoveryEnabled;
444379
return this;
@@ -545,7 +480,6 @@ public BesuNodeConfiguration build() {
545480
genesisConfigProvider,
546481
p2pEnabled,
547482
p2pPort,
548-
tlsConfiguration,
549483
networkingConfiguration,
550484
discoveryEnabled,
551485
bootnodeEligible,

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.hyperledger.besu.ethereum.permissioning.LocalPermissioningConfiguration;
2626
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
2727
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
28-
import org.hyperledger.besu.pki.keystore.KeyStoreWrapper;
2928
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat;
3029
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
3130
import org.hyperledger.besu.tests.acceptance.dsl.node.Node;
@@ -69,7 +68,6 @@ public BesuNode create(final BesuNodeConfiguration config) throws IOException {
6968
config.getGenesisConfigProvider(),
7069
config.isP2pEnabled(),
7170
config.getP2pPort(),
72-
config.getTLSConfiguration(),
7371
config.getNetworkingConfiguration(),
7472
config.isDiscoveryEnabled(),
7573
config.isBootnodeEligible(),
@@ -583,7 +581,6 @@ public BesuNode createQbftTLSNodeWithValidators(
583581
new BesuNodeConfigurationBuilder()
584582
.name(name)
585583
.miningEnabled()
586-
.p2pTLSEnabled(name, type)
587584
.jsonRpcConfiguration(node.createJsonRpcWithIbft2EnabledConfig(false))
588585
.webSocketConfiguration(node.createWebSocketEnabledConfig())
589586
.devMode(false)
@@ -596,21 +593,6 @@ public BesuNode createQbftTLSNodeWithValidators(
596593
.build());
597594
}
598595

599-
public BesuNode createQbftTLSJKSNodeWithValidators(final String name, final String... validators)
600-
throws IOException {
601-
return createQbftTLSNodeWithValidators(name, KeyStoreWrapper.KEYSTORE_TYPE_JKS, validators);
602-
}
603-
604-
public BesuNode createQbftTLSPKCS12NodeWithValidators(
605-
final String name, final String... validators) throws IOException {
606-
return createQbftTLSNodeWithValidators(name, KeyStoreWrapper.KEYSTORE_TYPE_PKCS12, validators);
607-
}
608-
609-
public BesuNode createQbftTLSPKCS11NodeWithValidators(
610-
final String name, final String... validators) throws IOException {
611-
return createQbftTLSNodeWithValidators(name, KeyStoreWrapper.KEYSTORE_TYPE_PKCS11, validators);
612-
}
613-
614596
public BesuNode createQbftNodeWithValidators(final String name, final String... validators)
615597
throws IOException {
616598

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/pki/PKCS11Utils.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

besu/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ dependencies {
3434
api 'org.slf4j:slf4j-api'
3535

3636
implementation project(':config')
37-
implementation project(':pki')
3837
implementation project(':consensus:clique')
3938
implementation project(':consensus:common')
4039
implementation project(':consensus:ibft')

0 commit comments

Comments
 (0)