test

package
v0.5.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

Go-ipfix Tests

Go-ipfix uses fake certificates for unit test and integration test. The fake certificates are generated manually and saved at cert.go. The developers need to renew the certificates before they expire following the steps below.

  1. Generate a fake CA cert and save the content in ca-cert.pem to FakeCACert.
    openssl genrsa 2048 > ca-key.pem  
    openssl req -new -x509 -nodes -days 1000 -key ca-key.pem > ca-cert.pem
    
  2. Generate the client certificate with RSA2048. Save the content in client-key.pem to FakeKey and client-cert.pem to FakeCert. Repeat this step for FakeClientKey and FakeClientCert.
    openssl req -newkey rsa:2048 -days 1000 -nodes -keyout client-key.pem > client-req.pem
    echo subjectAltName = IP:127.0.0.1 > extfile.cnf
    openssl x509 -req -in client-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem -extfile extfile.cnf
    
  3. Generate the client certificate with ED25519. Save the content in client-key.pem to FakeKey2 and client-cert.pem to FakeCert2.
    openssl genpkey -algorithm ed25519 -out client-key.pem
    openssl req -new -sha256 -key client-key.pem -out client-req.pem
    echo subjectAltName = IP:127.0.0.1 > extfile.cnf
    openssl x509 -req -in client-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem -extfile extfile.cnf
    

Documentation

Index

Constants

View Source
const (
	// TODO: update the certs before 2025-02-01
	FakeCACert = `` /* 1350-byte string literal not displayed */

	FakeKey = `` /* 1708-byte string literal not displayed */

	FakeCert = `` /* 1241-byte string literal not displayed */

	FakeClientKey = `` /* 1704-byte string literal not displayed */

	FakeClientCert = `` /* 1188-byte string literal not displayed */

	FakeKey2 = `-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIERk8ms6LU+Anq+cWg9pbfJ3KbXmWdjYaWKdMZKBV4sf
-----END PRIVATE KEY-----
`
	FakeCert2 = `` /* 847-byte string literal not displayed */

)

Variables

View Source
var (
	// Hard coding the kafka msg in bytes. Need to figure out a way to generate this.
	Msg1ForFlowType1 = []byte{}/* 168 elements not displayed */

	Msg2ForFlowType1 = []byte{}/* 216 elements not displayed */

	Msg1ForFlowType2 = []byte{}/* 168 elements not displayed */

	Msg2ForFlowType2 = []byte{}/* 216 elements not displayed */

)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL