Near Miss Dog Attack - Protection Options That Keep Me Out Of Jail

Per guidelines for the post - I live in Alabama.
I take a daily walk around my neighborhood (that has an HOA). On one of my walks, a dog ran out after me; teeth barred, snarling, hair raised - obviously intent on attacking me. At the last moment when the dog was inches from my leg, the owner popped his head out and called the dog back into the yard and admonished me, saying "you must have done something to make her mad". I was walking on the opposite side of the street reading an email as I was walking, doing nothing that could have been construed as aggressive.
After that incident, I called animal control and reported the incident. The next day on my walk, as I passed that house - the owner was on the porch and the dog was in the yard. The dog hopped up and started towards me (on the opposite side of the street). The owner called the dog back and after it heeled at his chair, he began shouting obscenities at me until I was out of earshot. On the days I have passed his house and he is outside, he continues to cuss me until I pass by. I have alerted the HOA to everything in this thread without a response.
Question -
I am now taking my pistol and knife on my walks in case the dog is unleashed again and comes after me - but after reading some legal forums it seems even in the event the dog actually attacks me and I do manage to defend myself either with a gun or knife that I could still do jailtime. I would like to walk without fear of dog attack or any legal repercussions for defending myself. What are my options to keep myself safe and within the boundaries of my legal rights?
[link] [comments]