Skip to content

Commit 6574683

Browse files
committed
2021.2 patch 5 Release
1 parent 0d2d07c commit 6574683

10 files changed

Lines changed: 540 additions & 55 deletions

File tree

RELEASE.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes for
22
P4Java, the Perforce Java API
33

4-
Version 2021.2 Patch 3
4+
Version 2021.2 Patch 5
55

66
Introduction
77

@@ -120,6 +120,42 @@ Known Limitations
120120

121121
<java-home>/lib/security/local_policy.jar
122122
<java-home>/lib/security/US_export_policy.jar
123+
124+
-------------------------------------------
125+
Updates in 2021.2 Patch 5
126+
127+
#2299942 (Job #108736)
128+
P4TRUST is no longer required for SSL connections where the server
129+
provides a certificate that's not self-signed and the certificate
130+
chain can be verified by the client. If verified, P4TRUST is
131+
not required.
132+
133+
The default java truststore is used unless you specify an
134+
alternative truststore with java system properties
135+
javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword
136+
137+
Chain Validation can be disabled using p4java property
138+
secureClientCertValidate set to 0 which does P4TRUST only.
139+
Setting to 2 will skip Chain validation and will ensure
140+
the server certificates' subject or subject alternate names
141+
match the hostname in the server URI. The default of 1 will
142+
validate the chain. Both 1 and 2 fallback to P4TRUST if
143+
the chain cannot be validated.
144+
145+
Fingerprints will now read and write the hostname in
146+
addition to the IP in the P4TRUST file. Set the p4java property
147+
secureClientTrustName to 0 to only write the IP. The default of
148+
1 writes entries for both the IP and hostname. A value of 2
149+
will only write the hostname. A matching fingerprint for either
150+
the IP or hostname will establish trust.
151+
152+
153+
-------------------------------------------
154+
Updates in 2021.2 Patch 4
155+
156+
#2286431 (Job #099302)
157+
Fixed parallel sync authetication issue on case insensitive servers.
158+
Fixes JENKINS-48525 and JENKINS-68104.
123159

124160
-------------------------------------------
125161
Updates in 2021.2 Patch 3
@@ -128,7 +164,7 @@ Updates in 2021.2 Patch 3
128164
Fixed parallel sync batchsize.
129165

130166
#2277668 (Job #110201)
131-
Parallel sync now passes charset to parallel threads.
167+
Parallel sync now passes charset to parallel threads.
132168

133169
-------------------------------------------
134170
Updates in 2021.2 Patch 2

src/main/java/com/perforce/p4java/impl/generic/core/DefaultParallelSync.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,14 @@ public void run() {
7575

7676
server.setCurrentServerInfo(cmdEnv.getServer().getCurrentServerInfo());
7777
server.setUserName(cmdEnv.getServer().getUserName());
78-
server.setAuthTicket(cmdEnv.getServer().getAuthTicket());
7978
server.setCurrentClient(cmdEnv.getServer().getCurrentClient());
8079
server.setWorkingDirectory(cmdEnv.getServer().getWorkingDirectory());
8180
server.setTrustFilePath(cmdEnv.getServer().getTrustFilePath());
8281
server.setTicketsFilePath(cmdEnv.getServer().getTicketsFilePath());
8382
server.setCharsetName(cmdEnv.getServer().getCharsetName());
8483
server.connect();
84+
// P4JAVA-1264: must call setAuthTicket() after connect() to properly cache the ticket.
85+
server.setAuthTicket(cmdEnv.getServer().getAuthTicket());
8586

8687
//pass the result to the handle result
8788
Map<String, Object>[] results = server.execMapCmd("transmit", args.toArray(new String[]{}), null);

src/main/java/com/perforce/p4java/impl/mapbased/rpc/NtsServerImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/**
2-
*
1+
/*
2+
* Copyright 2009 - 2022 Perforce Software Inc., All Rights Reserved.
33
*/
44
package com.perforce.p4java.impl.mapbased.rpc;
55

@@ -614,8 +614,9 @@ protected ExternalEnv setupCmd(String cmdName, String[] cmdArgs,
614614
// Should use tags?
615615
boolean useTags = useTags(cmdName, cmdArgs, inMap, isStream);
616616

617-
// Check fingerprint
618-
checkFingerprint(rpcConnection);
617+
// Check certificate chain and/or fingerprint.
618+
// An exception (ConnectionException) is thrown if ssl but not trusted.
619+
trustConnectionCheck(rpcConnection);
619620

620621
ExternalEnv env = new ExternalEnv(
621622
this.getUsageOptions().getProgramName(),
@@ -749,4 +750,5 @@ public IServerAddress getServerAddressDetails() {
749750

750751
return builder.build();
751752
}
753+
752754
}

src/main/java/com/perforce/p4java/impl/mapbased/rpc/OneShotServerImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/**
2-
*
1+
/*
2+
* Copyright 2009 - 2022 Perforce Software Inc., All Rights Reserved.
33
*/
44
package com.perforce.p4java.impl.mapbased.rpc;
55

@@ -604,9 +604,10 @@ protected ExternalEnv setupCmd(RpcPacketDispatcher dispatcher,
604604

605605
// Should use tags?
606606
boolean useTags = useTags(cmdName, cmdArgs, inMap, isStream);
607-
608-
// Check fingerprint
609-
checkFingerprint(rpcConnection);
607+
608+
// Check certificate chain and/or fingerprint.
609+
// An exception (ConnectionException) is thrown if ssl but not trusted.
610+
trustConnectionCheck(rpcConnection);
610611

611612
ExternalEnv env = new ExternalEnv(
612613
this.getUsageOptions().getProgramName(),
@@ -694,6 +695,7 @@ protected ExternalEnv setupCmd(RpcPacketDispatcher dispatcher,
694695
return env;
695696
}
696697

698+
697699
/**
698700
* Get server address object
699701
*

src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcPropertyDefs.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,38 @@ public class RpcPropertyDefs {
200200
*/
201201
public static final String RPC_DEFAULT_SECURE_SOCKET_PROTOCOL = "TLS";
202202

203+
/**
204+
* Client Certificate validation Method, corresponds to p4api ssl.client.cert.validate
205+
* <p>
206+
* 0: always use the P4TRUST mechanism. This is pre 2022.1 behavior.<br/>
207+
* 1: validate the certificate chain (default)<br/>
208+
* 2: validate the subject matches the P4PORT. The chain is not validated. but the CN of the
209+
* certificate is compared to the host in the P4PORT.<br/>
210+
*/
211+
public static final String RPC_SECURE_CLIENT_CERT_VALIDATE_NICK = "secureClientCertValidate";
212+
213+
214+
/**
215+
* Default for Certificate validation Method
216+
*/
217+
public static final int RPC_DEFAULT_SECURE_CLIENT_CERT_VALIDATE = 1;
218+
219+
/**
220+
* P4TRUST file entries, corresponds to p4api ssl.client.trust.name
221+
* <br/>
222+
* 0: Only IP address This is pre 2022.1 behavior.<br/>
223+
* 1: both IP and hostname (default)<br/>
224+
* 2: Only hostname The chain is not validated. but the CN of the
225+
* certificate is compared to the host in the P4PORT.<br/>
226+
*/
227+
public static final String RPC_SECURE_CLIENT_TRUST_NAME_NICK = "secureClientCertValidate";
228+
229+
230+
/**
231+
* Default for Certificate validation Method
232+
*/
233+
public static final int RPC_DEFAULT_SECURE_CLIENT_TRUST_NAME = 1;
234+
203235
/**
204236
* If this property is set and equals "false", do not attempt to set enabled
205237
* protocol versions (SSLSocket.setEnabledProtocols()) for the connection

0 commit comments

Comments
 (0)