Tests must pass against all of the following Neo4j versions:
- Neo4j 3.5 (legacy)
- Neo4j 4.4 (LTS)
- Neo4j 5.26
- Neo4j 2025.12.1 (latest)
- Neo4j Aura (cloud)
- Linux (via Docker Swift container)
- macOS (native)
For each local Neo4j version, test both:
- Unencrypted connections (port 7687)
- TLS-encrypted connections (with self-signed certificates)
Neo4j Containers:
- graphgopher-neo4j: Unencrypted (macOS: localhost:7687, Docker: graphgopher-neo4j:7687)
- neo4j-tls: TLS-enabled (macOS: localhost:7691, Docker: neo4j-tls:7687)
Swift Linux Container:
# Create Swift container on the same network as Neo4j
docker run -d --name swift-linux \
--network neo4j-tls-docker_default \
-v /path/to/Neo4j:/workspace/Neo4j \
swift:6.0 tail -f /dev/null
# Connect to Neo4j network if needed
docker network connect neo4j-tls-docker_default graphgopher-neo4jLinux (Docker):
# Run all unit tests (skip legacy sync socket tests)
docker exec -w /workspace/Neo4j/Bolt-swift \
-e NEO4J_HOSTNAME=graphgopher-neo4j \
-e NEO4J_PASSWORD=j4neo \
swift-linux swift test --enable-test-discovery \
--skip "UnencryptedSocketTests" --skip "EncryptedSocketTests"
# Run async integration tests only
docker exec -w /workspace/Neo4j/Bolt-swift \
-e NEO4J_HOSTNAME=graphgopher-neo4j \
-e NEO4J_PASSWORD=j4neo \
swift-linux swift test --enable-test-discovery --filter "AsyncSocketTests"macOS:
# Run all tests
swift test
# Run async integration tests
swift test --filter "AsyncSocketTests"
# Run TLS tests (requires neo4j-tls container)
swift test --filter "EncryptedSocketTests"Tests support environment variable overrides:
NEO4J_HOSTNAME: Override hostname (required for Docker)NEO4J_PORT: Override portNEO4J_USERNAME: Override usernameNEO4J_PASSWORD: Override password
Or edit Tests/BoltTests/BoltSwiftTestConfig.json:
{
"username": "neo4j",
"password": "j4neo",
"hostname": "localhost",
"port": 7687,
"hostUsesSelfSignedCertificate": false
}TLS tests use Network.framework on macOS. The neo4j-tls Docker container provides a TLS-enabled Neo4j on port 7691.
Certificate setup is in /path/to/neo4j-tls-docker/certificates/:
public.crt: PEM certificatepublic.der: DER certificate for macOS Security frameworkprivate.key: Private key
The certificate must have extendedKeyUsage = serverAuth for macOS to accept it.
The library supports:
- Bolt 3 (Neo4j 3.5+)
- Bolt 4.0-4.4 (Neo4j 4.0-4.4)
- Bolt 5.0-5.6 (Neo4j 5.x)
Handshake proposes versions with ranges for better negotiation.
| Bolt Version | Auth in HELLO | Separate LOGON | LOGOFF Support |
|---|---|---|---|
| 3.0 - 5.0 | Yes | No | No |
| 5.1+ | No | Yes (required) | Yes |
Key difference for Bolt 5.1+:
- HELLO message contains only
user_agentand optionalroutingcontext (no auth) - Authentication must be sent via separate LOGON message (signature 0x6A)
- Re-authentication is supported via LOGOFF (signature 0x6B) then LOGON
notifications_minimum_severity: Minimum notification levelnotifications_disabled_categories: List of disabled notification categories
No current known issues.
# Build
swift build
# Test all (macOS)
swift test
# Test specific suite
swift test --filter "AsyncSocketTests"
# Linux: Run all tests
docker exec -w /workspace/Neo4j/Bolt-swift \
-e NEO4J_HOSTNAME=graphgopher-neo4j \
-e NEO4J_PASSWORD=j4neo \
swift-linux swift test --enable-test-discovery \
--skip "UnencryptedSocketTests" --skip "EncryptedSocketTests"