gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/gmtls/handshake_unix_test.go (about)

     1  // Copyright (c) 2022 zhaochun
     2  // core-gm is licensed under Mulan PSL v2.
     3  // You can use this software according to the terms and conditions of the Mulan PSL v2.
     4  // You may obtain a copy of Mulan PSL v2 at:
     5  //          http://license.coscl.org.cn/MulanPSL2
     6  // THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
     7  // See the Mulan PSL v2 for more details.
     8  
     9  //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
    10  // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
    11  
    12  /*
    13  gmtls是基于`golang/go`的`tls`包实现的国密改造版本。
    14  对应版权声明: thrid_licenses/github.com/golang/go/LICENSE
    15  */
    16  
    17  package gmtls
    18  
    19  import (
    20  	"errors"
    21  	"syscall"
    22  )
    23  
    24  func init() {
    25  	isConnRefused = func(err error) bool {
    26  		return errors.Is(err, syscall.ECONNREFUSED)
    27  	}
    28  }