Leaving here the relevant sections from my files as reference,
#rc.conf,
wpa_supplicant=YES
wpa_supplicant_flags="-B -D bsd -i iwn0 -c /etc/wpa_supplicant.conf"
dhcpcd=YES
dhcpcd_flags="-qM iwn0 -b"
# ifconfig.iwn0
up
media autoselect
mode 11g
dhcp
# wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
ap_scan=1
fast_reauth=1
eapol_version=2
# open network
network={
ssid=
key_mgmt=NONE
auth_alg=OPEN
}
# private network
network={
ssid="****"
key_mgmt=WPA-PSK
psk="****"
}