code: func (c *Config) Connect() (*Conn, error) {
  	switch c.Security {
  	case SecurityNone:
  		conn, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", c.Server, c.Port))
  		if err != nil {
  			return nil, fmt.Errorf("Connection error: %v", err)
  		}
  		return &Conn{Conn: conn, Config: c}, nil
  	case SecurityTLS:
  		conn, err := ldap.DialTLS("tcp", fmt.Sprintf("%s:%d", c.Server, c.Port), &tls.Config{ServerName: c.Server})
  		if err != nil {
  			return nil, fmt.Errorf("Connection error: %v", err)
  		}
  		return &Conn{Conn: conn, Config: c}, nil
  	case SecurityStartTLS:
  		conn, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", c.Server, c.Port))
  		if err != nil {
  			return nil, fmt.Errorf("Connection error: %v", err)
  		}
  		err = conn.StartTLS(&tls.Config{ServerName: c.Server})
  		if err != nil {
  			return nil, fmt.Errorf("Connection error: %v", err)
  		}
  		return &Conn{Conn: conn, Config: c}, nil
  	default:
  		return nil, errors.New("Configuration error: invalid SecurityType")
  	}
  }
docs: //Connect returns an open connection to an Active Directory server or an error if one occurred.