File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -129,15 +129,18 @@ - (CBLTLSIdentity*) issuer {
129129
130130- (CBLTLSIdentity*) createIdentity {
131131 Assert (_identityCount++ <= kTestMaxIdentity );
132-
133132 NSError * error;
134- NSString * name = [self identityNameForNumber: _identityCount];
135- NSDictionary * attrs = @{ kCBLCertAttrCommonName : name };
133+ NSString * label = [self identityNameForNumber: _identityCount];
134+
135+ uint64_t timestamp = (uint64_t )([[NSDate date ] timeIntervalSince1970 ] * 1000 );
136+ NSString * cn = [NSString stringWithFormat: @" %@ -%llu " , label, timestamp];
137+ NSDictionary * attrs = @{ kCBLCertAttrCommonName : cn };
138+
136139 CBLTLSIdentity* identity = [CBLTLSIdentity createIdentityForKeyUsages: kTestKeyUsages
137140 attributes: attrs
138141 expiration: nil
139142 issuer: [self issuer ]
140- label: name
143+ label: label
141144 error: &error];
142145
143146 AssertNotNil (identity);
@@ -1185,7 +1188,6 @@ - (void) runConflictResolverTestWithResolver: (nullable MultipeerConflictResolve
11851188 18. Check the doc1 in both peers and verify that the its body is {"greeting": "howdy"}.
11861189 */
11871190- (void ) testDefaultConflictResolver {
1188- CBLLogSinks.console = [[CBLConsoleLogSink alloc ] initWithLevel: kCBLLogLevelVerbose ];
11891191 [self runConflictResolverTestWithResolver: nil verifyBlock: ^BOOL (CBLDocument* resolvedDoc) {
11901192 return [[resolvedDoc stringForKey: @" greeting" ] isEqualToString: @" howdy" ];
11911193 }];
Original file line number Diff line number Diff line change @@ -121,14 +121,18 @@ class MultipeerReplicatorTest: CBLTestCase {
121121 assert ( identityCount <= kTestMaxIdentity)
122122 identityCount += 1
123123
124- let name = identityNameForNumber ( identityCount)
125- let attrs = [ certAttrCommonName: name]
124+ let label = identityNameForNumber ( identityCount)
125+
126+ let timestamp = UInt64 ( Date ( ) . timeIntervalSince1970 * 1000 )
127+ let cn = " \( label) - \( timestamp) "
128+ let attrs = [ certAttrCommonName: cn]
129+
126130 return try TLSIdentity . createIdentity (
127131 for: kTestKeyUsages,
128132 attributes: attrs,
129133 expiration: nil ,
130134 issuer: self . issuer,
131- label: name )
135+ label: label )
132136 }
133137
134138 typealias CollectionConfigBlock = ( inout MultipeerCollectionConfiguration ) -> Void
You can’t perform that action at this time.
0 commit comments