I have been trying for a few sessions to connect to a WPA2 access point using a 64 character hex key. Can someone post a working hostname.if example for connecting to said ap using dhcp? I give up for now. its been a lot of reading and a lot of errors.

I'm using 4.6 GENERIC
the nic is ath0
I can connect to wep and open access points.
Just never successfully connected to a WPA2 or WPA ap.

Hello there, i also had the same problem with character lengths on my WPA2 key, i regenerated a new key (didn't seem to like special characters much) removed the 0x from the beginning of my password and mine started working.

Here is a copy paste of my working hostname.iwn0 file;

dhcp nwid NETWORKNAME wpa wpapsk $(wpa-psk NETWORKNAME WIFIPASSWORD)

__________________
The more you learn, the more you realize how little you know ....

Ah, now I see the problem. You are using wpa-psk when you already have a hexadecimal key. The program creates the key from a plain text passphrase. From wpa-psk(8), emphasis mine:

Quote:

wpa-psk generates a 256-bit pre-shared key from a service set identifier
(SSID) and a passphrase. The passphrase must be a sequence of between 8
and 63 ASCII-encoded characters. The length of the SSID must be between
1 and 32 octets.